2011-03-12 133 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時都會自動應用它們。