将 GVim 配色方案更改为类似于命令行 Vim [英] Change GVim Color Scheme to be Like Command Line Vim

查看:31
本文介绍了将 GVim 配色方案更改为类似于命令行 Vim的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以让 GVim 的配色方案与命令行版本 Vim 中的配色方案完全匹配?相比白色背景的 GVim,我更喜欢 Vim 的颜色,但我仍然想使用 GVim,因为 shift 键在命令行版本上映射得不好.

Is it possible to make the color scheme of GVim to exactly match the one in the command line version Vim? I like the colors of Vim more than the white-backgrounded GVim, but I still want to use GVim because the shift key doesn't map well on the command line version.

推荐答案

是的,可以让 gvim 与终端 Vim 完全匹配.(不过,并非总是可以走另一条路,gvim 允许更多颜色,因此如果您使用 gvim 作为基础,则不能总是使终端 vim 匹配.)

Yes, it is possible to make gvim exactly match terminal Vim. (It's not always possible to go the other way, though, gvim allows more colors so you can't always make terminal vim match if you're using gvim as your base.)

颜色由 ':highlight' 命令控制 ( http://vimdoc.sourceforge.net/htmldoc/syntax.html#:highlight ) ,它允许您为 gvim(guifg 和 guibg)指定不同于终端 vim 颜色(ctermfg 和 ctermbg)的颜色.您所要做的就是确保分配给 guifg 和 guibg 的颜色与分配给 ctermfg 和 ctermbg 的颜色相同.这是一个可能会让你前进的脚本:http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim

Colors are controlled with the ':highlight' command ( http://vimdoc.sourceforge.net/htmldoc/syntax.html#:highlight ) , which allows you to specify colors for gvim (guifg and guibg) differently from colors for terminal vim (ctermfg and ctermbg). All you have to do is make sure that the colors you assign to guifg and guibg are the same as you assign to ctermfg and ctermbg. Here's a script that might get you going: http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim

注意:':colorscheme' 命令通过运行 Vim 的'/colors' 目录中的一个colorscheme"文件中的命令来与 ':highlight' 命令相匹配.颜色方案文件本身主要由高亮命令组成,这些命令为颜色方案中的所有不同元素设置颜色.值得阅读帮助以了解所有这些如何组合在一起.此外,如果您访问 Vim 站点,您会发现大量用于更改颜色方案的脚本.其中大部分是面向 gvim 的,但许多尝试对 gvim 和终端 vim 友好.你可以从这里开始:http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search 只需找到一个你喜欢的并将文件放入您的/colors 目录.

Note: the ':colorscheme' command fits in with the ':highlight' command by running the commands in a "colorscheme" file found in Vim's '/colors' directory. The colorscheme file itself will be mostly composed of highlight commands that set colors for all the different elements in the colorscheme. It's worth reading the help to see how all this fits together. Also, if you go to the Vim site you will find a bazillion scripts that are devoted to changing your colorscheme. Most of these are geared towards gvim, but many try to be friendly to both gvim and terminal vim. You can start here: http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search Just find one you like and plop the file in your /colors directory.

或者,在此处查看示例:http://vimcolorschemetest.googlecode.com/svn/html/index-pl.html

Alternatively, take a look at samples here: http://vimcolorschemetest.googlecode.com/svn/html/index-pl.html

这篇关于将 GVim 配色方案更改为类似于命令行 Vim的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆