Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a VIM color scheme?

Tags:

vim

vi

vim-plugin

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?

like image 245
mindthief Avatar asked Dec 09 '10 09:12

mindthief


People also ask

What is the best color scheme for Vim?

Badwolf is a color scheme for Vim created by Steve Losh. It is a high-contrast color scheme with dark background making it great for coding.

How do I apply a vim theme?

config/nvim/colors/nord. vim . Then the :colorscheme nord command will be able to load the theme. By the way, vim-plug plugin is great for managing vim and neovim plugins and colorschemes.

How do I change the color scheme in Gvim?

You can set your preferred color scheme in gvim for MS Windows by editing the file _vimrc in C:\Program Files\Vim or the location where you installed Vim. Save the file and start gvim you will see your color scheme.


3 Answers

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

like image 101
idbrii Avatar answered Sep 20 '22 15:09

idbrii


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

like image 25
Grzegorz Gierlik Avatar answered Sep 20 '22 15:09

Grzegorz Gierlik


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

like image 45
DaVinci Avatar answered Sep 21 '22 15:09

DaVinci