38

I have been looking around for VIM color schemes and found some great ones out there (esp. by using http://code.google.com/p/vimcolorschemetest/), but I always want to change a few aspects of each one I find. So I've decided now that what I really want to do is make my own, or be able to customize the ones I find on the fly. Basically, what I want to know is:

1) How do I write a vim color scheme -- are there any good (quick) tutorials?

2) How do I add language-specific customizations? Like say for Python, I might be interested in having different colors for classes and methods (is this even possible? What level of customization is possible?). Anything you can tell me about how to customize for specific languages would be fantastic! (esp. python, but also others like C, Java, Ruby would be great)

3) Are there are good, complete (ideally well-commented) templates that I could start from which contain all aspects of a color scheme, like background, text, language specific stuff, and the like?

5 Answers 5

46

Vivify lets you interactively create vim colorschemes with color pickers and previews your scheme using several code samples.

2
  • @desimusxvii How do I change python-builtin function colors?
    – Mario
    Apr 3, 2014 at 12:50
  • I literally thought of writing something like this today! Glad I didn't do it lol
    – vexe
    Aug 22, 2014 at 16:54
26

I didn't watch the "Creating colorschemes for Vim" episode of VIMcasts, but the others are really good.

0
14

colorschemes are actually vim scripts. You use the hi command for coloring, which works like hi TextType guifg=#hexforegroundcolor guibg=#hexbgcolor gui=bold/italic/underlined/undercurled (assumed you use gvim). If you type :hionly, you get a complete list of text types with their current highlighting
see also http://vimdoc.sourceforge.net/htmldoc/syntax.html#:colorscheme

8

May be you can find this colorscheme template useful: http://www.vim.org/scripts/script.php?script_id=106

The original description is

"The philosophy here is to provide a ready-to-uncomment list of highlight commands for all the important groups. Then you can deviate from the default until you come up with one you like."

3
  • very nice, that looks like exactly what I was looking for in a template when I asked the question!
    – mindthief
    Sep 2, 2012 at 18:13
  • I did a Colorscheme some time ago too. Now that SourceForge is off the grid, it can be used instead. github.com/Heldraug/Vim-Colorscheme-Template
    – Heldraug
    Jul 18, 2015 at 4:02
  • 1
    this is great, excellent way to start understanding how to make a vim colorscheme
    – singmotor
    May 4, 2017 at 15:46
6

Launch vim, say ":help syntax", it has quick start etc.

For the complete templates look at your installation:

colorschemes are in /usr/share/vim/vimcurrent/colors/

languages syntax in /usr/share/vim/vimcurrent/syntax/

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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