Can anyone tell me how to change the Python colors in Vim. I've seen the following syntax but I'm not sure how to make it permanent.
:hi pythonComment ctermfg=2 gui=italic guifg=#408010
You can just put it in your .vimrc
file. (Without the leading :
, as favoretti mentioned.)
The vimrc file is loaded before any plugins, so I would expect it to be overwritten later in the initialisation process, or at least when the colourscheme is changed. The best approach would be to associate the new hi
command with the ColorScheme
event, so that it is triggered automatically when the colour scheme is changed.
To do so, put this in your vimrc:
autocmd ColorScheme * hi pythonComment ctermfg=2 gui=italic guifg=#408010
Syntax highlighting really belongs in the colorscheme file, not in .vimrc
or .gvimrc
. Find your current colorscheme under ~/.vim/colors
and add your statement to that file without the leading :
.