Vim colour schema Jul 15 2017
When you see colours displayed on vim, they are defined by highlight rules, and they are applied to groups (in the example below the group is Normal, you can view all of them running: :so $VIMRUNTIME/syntax/hitest.vim
) for example:
1
2
3
4
5
6
" Set the background colour to white
:highlight Normal ctermbg=White
" Set the background colour to yellow
:highlight Normal ctermbg=Yellow
" Set the background colour to none(back to normal)
:highlight Normal ctermbg=0
Where are colours defined? you can check the value of each colour for x-term256 here
So for example, if we were to change the normal colour to 70 (or Chartreuse3), like this:
1
highlight Normal ctermfg=70
the colour 70 has this definition:
1
hi x070_Chartreuse3 ctermfg=70 guifg=#5faf00 "rgb=95,175,0
which would look like this: #5faf00
See what we did there?
Hope that this gives you insight into how vim highlight works. Here are a few links you might find useful:
- http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax
- http://www.color-hex.com/color/5faf00
- https://www.sbf5.com/~cduan/technical/vi/vi-4.shtml#color
- http://vim.wikia.com/wiki/Xterm256colornamesforconsole_Vim
- http://alvinalexander.com/linux/vi-vim-editor-color-scheme-syntax
- https://jordanelver.co.uk/blog/2015/05/27/working-with-vim-colorschemes/
** If you want to check what else I'm currently doing, be sure to follow me on twitter @rderik or subscribe to the newsletter. If you want to send me a direct message, you can send it to derik@rderik.com.