Molokai for Vim
I've mentioned in the past some of the color scheme scripts that I've used to make Vim nicer, and there are some really nice ones. However, I was growing tired of them lately. I looked around the Vim site trying to find something better but came up empty handed.
Around that time I ran into Hamish Macpherson's blog, and noticed he was using a really nice color scheme on his code screenshots, and then read in one of his comments that it was a slightly modified version of the monokai theme for TextMate.
I decided to try porting them to Vim, though it's a very loose port. I've been using and tweaking it for a few weeks now, but I'm pretty satisfied with it. I decided to post it here just in case anyone else is interested.
There are two variations to the theme; which one is used can be controlled by setting the g:molokai_original variable in your .vimrc file.
The default option (molokai_original == 0) uses the dark gray background variation similar to Hamish' version, and looks like this:
With molokai_original == 1, the script will use the original monokai colors, and looks like this:
You can get the script from my dotfiles repository on github; where you'll find always the most recent version. Enjoy!








Molokai rocks!
Many thanks.
Absolutely fabulous!
Thanks for this port! Probably the best editor theme ever (at least the original version).
Looks great. Which font is that?
@David: It’s Envy Code R, by Damien Guard: http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released
Thanks
Kind of a VIM newb, so pardon if this is a question with an obvious answer, but…
When I use your theme in GVIM, it looks exactly as it does in the screenshot. However, when I try to use VIM from the terminal (ie, “vim example.rb”, “:colors molokai”), the background color doesn’t change to that of the theme, and the colors are all a little bit different than the ones in the screenshot- for instance, “@something” is kind of aqua instead of orange, etc… This has held true for my tests on OSX, linux, and windows. Is there a setting I’m not aware of?
Much appreciated!
@Alex: Keeping the colors 100% the same on the console is impossible simply because the capabilities aren’t there. A couple of things that might help:
- Make sure you’re using a console terminal capable of 256 colors; not all of them do (particularly on mac). You might need to explicitly force Vim to use that by doing “set t_Co=256″ on your .vimrc file.
- The windows console is well… totally unsupported, that only does 16 colors so it’s a mess