如何更改vim中针对C / C ++ / PHP的语法高亮? 我是否也可以更改背景颜色,使其与shell的颜色不同?
答案 0 :(得分:3)
在开始安装各种插件之前,请查看Vim附带的预安装配色方案。就我而言,我有很多:
# rpm -ql vim vim-common | grep color
/usr/share/vim/vim72/colors
/usr/share/vim/vim72/colors/README.txt
/usr/share/vim/vim72/colors/blue.vim
/usr/share/vim/vim72/colors/darkblue.vim
/usr/share/vim/vim72/colors/default.vim
/usr/share/vim/vim72/colors/delek.vim
/usr/share/vim/vim72/colors/desert.vim
/usr/share/vim/vim72/colors/elflord.vim
/usr/share/vim/vim72/colors/evening.vim
/usr/share/vim/vim72/colors/koehler.vim
/usr/share/vim/vim72/colors/morning.vim
/usr/share/vim/vim72/colors/murphy.vim
/usr/share/vim/vim72/colors/pablo.vim
/usr/share/vim/vim72/colors/peachpuff.vim
/usr/share/vim/vim72/colors/ron.vim
/usr/share/vim/vim72/colors/shine.vim
/usr/share/vim/vim72/colors/slate.vim
/usr/share/vim/vim72/colors/torte.vim
/usr/share/vim/vim72/colors/zellner.vim
/usr/share/vim/vim72/ftplugin/dircolors.vim
/usr/share/vim/vim72/syntax/colortest.vim
/usr/share/vim/vim72/syntax/dircolors.vim
/usr/share/vim/vim72/syntax/syncolor.vim
/usr/share/vim/vimfiles/after/colors
/usr/share/vim/vimfiles/colors
要更改它,只需使用:
colorscheme darkblue
您也可以下载配色方案,然后将它们放入VIMRC子目录“colors”并以相同的方式加载它们。我喜欢这个例子:http://ethanschoonover.com/solarized
当然,你可以修改那些配色方案。只需将“default.vim”(或您喜欢的那个)复制到您的VIMRC /颜色并编辑它以更改您想要的颜色。
答案 1 :(得分:1)
你必须给它一个语法文件来加载和玩它:
http://www.vim.org/scripts/script.php?script_id=1571
启用它(如果你不知道),:set syntax
有关更改vim背景的信息,请点击此处: