As we know, Setting a comfortable color scheme for VIM is very important for protecting programmers’ eyes and helping us read the code quickly. However, we usually found it isn’t easy to set a successful color scheme. Today, There is a simple way that can help us to set our color scheme for VIM.
Usually, we can modify the VIM style in the file ~/.vimrc. There are a lot of information about how to encode that file on Internet. So we can learn those parameters at any time. Today, we only care the parameter “colorscheme”, because the parameter can help us setting a comfortable color scheme. Setting the parameter in the file ~/.vimrc is as following:
colorscheme xxx
or
color xxx
NOTE: xxx is our color scheme.
OK, next, we will discuss how to encode a xxx(your color scheme).
At the first, There are others’ color schemes in the directory:
/usr/share/vim/vim80/colors.
NOTE: the “vim80” maybe is different your system, so you need to modify it.
For example, if we encode “colorscheme blue”, the system will call the blue.vim when opening a file by VIM, and setting the color scheme according to the content of blue.vim.
Secondly, we can choose a suitable scheme for our VIM, and set it. But if we don’t like those schemes. we can encode a new color scheme by referring to those scheme. The following picture is the screenshot of blue.vim.

We can see some item, such as “Normal”, “comment”, “preproc” and so on, and the followings are parameters of the item, such as “guifg”, “guibg”, “cternfg” and so on.
So we can copy a file .vim, modify its name(such as “xxx.vim”), set the color scheme according to your hobbits, and save it.
Finally, we set the xxx to be the color scheme in the file ~/.vimrc.
OK , everything is over, we can read our code happily.
VIM颜色方案设置指南
2万+

被折叠的 条评论
为什么被折叠?



