I want to change one of gvim's existing colorscheme's syntax coloring. For example, in the colorscheme called 'Ron', it highlights python comments in white. I want to change it to red.

According to this thread gvim how to change exisitng colorscheme's syntax colors? it says "gvim has files (eg. slate.vim) in a colors directory wherever it is installed. Where that is OS dependent. You could change them in there and it will change for all users."

So I need to look for a file called ron.vim (in the colors directory) and change the syntax coloring in that file. I am using Lubuntu. Any idea where the vim files / colors directory for vim are located?

  • You can try this overkill command that will find all *.vim files on your hard drive : find / -name "*.vim" and then check if you can find what you are looking for in one of theses files. – user2196728 Jan 5 '14 at 18:20

The file is located at $VIMRUNTIME/colors/slate.vim which you can view by typing

:e $VIMRUNTIME/colors/slate.vim

from within vim. Most likely the file will be read only which is good. You DO NOT want to modify files that are installed by vim because the changes will be overridden. Save the color scheme to ~/.vim/colors/slate-mine.vim with :w and modify this copied colorscheme and then call it with

colorscheme slate-mine

Use whatever name you want to. You will need to create ~/.vim/colors if it does not exist before hand.

  • okay thanks. I'm new to linux directories, where exactly would ~/.vim be located? When I opened :e $VIMRUNTIME/colors/slate.vim, it mentioned that the file is located at /usr/share/vim/vim73/colors, so is ~/.vim basicallt /usr/share/vim ? – user216485 Jan 5 '14 at 18:38
  • @user216485 ~ is your home directory. Do an echo ~ in your shell to figure out where it is. – FDinoff Jan 5 '14 at 18:39
  • Copying the color scheme file ron.vim to ~/.vim/colors and modifying it there will change it for just you. If you want to change it for all users, copy it instead to $VIM/vimfiles/colors. You can find the value of $VIM by executing :echo $VIM in Vim. You don't need to rename the file if you don't want to. When you execute :colors ron, Vim will use the first color scheme named ron.vim in 'runtimepath' which has ~/.vim and $VIM/vimfiles ahead of $VIMRUNTIME. – garyjohn Jan 5 '14 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.