2011-03-12 74 views
2

我不想学习如何创建一个新的方案。我只是想在默认颜色方案无处不在另一种颜色替换一些颜色。更换VIM的颜色,而不用发明配色方案

这是(由布莱姆·米勒默认颜色方案)如何default.vim看起来像评论删除:

hi clear Normal 
set bg& 

hi clear 

if exists("syntax_on") 
    syntax reset 
endif 

let colors_name = "default" 

正如你看到它并没有定义它使用的任何colrs不管使用什么是颜色(在C代码中,我猜)。

所以,我怎么能替换一些颜色与另一种颜色无处不在?

例子:默认的配色方案突出了文本的一些群体与色彩“丑”,我希望它有色彩“中性”突出显示。

是问题不够清楚了吗?

回答

1
    *:hi-default* *:highlight-default* 
The [default] argument is used for setting the default highlighting for a 
group. If highlighting has already been specified for the group the command 
will be ignored. Also when there is an existing link. 

Using [default] is especially useful to overrule the highlighting of a 
specific syntax file. For example, the C syntax file contains: > 
    :highlight default link cComment Comment 
If you like Question highlighting for C comments, put this in your vimrc file: > 
    :highlight link cComment Question 
Without the "default" in the C syntax file, the highlighting would be 
overruled when the syntax file is loaded. 
0

以下是如何在Vim中随处替换颜色。首先,在vim使用:highlight命令查看所有预定义色组的一个样本。您还应该阅读:help highlight的输出以查看所有颜色突出显示组的定义。

一旦你已经确定你想改变一个候选替换组(更好的色彩)的组,请使用如下命令:

" Fix the difficult-to-read default setting for search/replace text 
" highlighting. The bang (!) is required since we are overwriting the 
" DiffText setting. Use the ":highlight" command in vim to see 
" alternate color choices if you don't like "Todo" or "StatusLine" 
highlight! link IncSearch Todo   " Yellow 
highlight! link  Search StatusLine  " Light tan 

" Fix the difficult-to-read default setting for diff text highlighting. 
" The bang (!) is required since we are overwriting the DiffText 
" setting. The highlighting for "Todo" also looks nice (yellow) if you 
" don't like the "MatchParen" (Aqua) diff color. 
highlight! link DiffText MatchParen  " Aqua 
" highlight! link DiffText Todo  " Yellow 

highlight vim的帮助表示你也可以指定颜色十六进制RGB像:

:highlight Comment guifg=#11f0c3 guibg=#ff00ff 

也有很多很好的信息可以通过使用:help syntax发现。

与往常一样,一旦找到你喜欢的颜色,你应该将它们保存在〜/ .vimrc文件中(当然保存在Git中),这样每次启动GVim时都会自动应用它们。