Unbuntu has auto-configured Vim to use syntax highlighting for text (mostly, programs and configuration files of course) editing, the problem however, is that some of the colors appear to be darker than wanted on SSH console and itâ€™s a little hard to recognize comfortably.
So how can we change the default colors of the syntax highlighting?
- Locate Vim configuration file which is located at /etc/vim/vimrc, add a line after â€˜syntax onâ€™: colorscheme desert
- Now that we are prescribing Vim to use the syntax color scheme desert, we will want to find the scheme file to change the colors that we donâ€™t feel comfortable with. The desert color scheme file is located at: /usr/share/vim/vimcurrent/colors/desert.vim
- Proceed to open it with vi and replace the color values with new ones. For example, the default comment color may be a little too dark on a black screen, letâ€™s make it lighter by changing
hi Comment ctermfg=darkcyan
hi Comment ctermfg=blue
- Reload the vimrc configuration file by performing â€˜source /etc/vim/vimrcâ€™ at shell.