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:

molokai normal

With molokai_original == 1, the script will use the original monokai colors, and looks like this:

molokai original

You can get the script from my dotfiles repository on github; where you'll find always the most recent version. Enjoy!

Technorati tags: ,

Comments (8)

ManuAugust 14th, 2008 at 6:18 am

Molokai rocks!
Many thanks.

danielSeptember 28th, 2008 at 12:32 pm

Absolutely fabulous!

RichMay 29th, 2009 at 7:20 pm

Thanks for this port! Probably the best editor theme ever (at least the original version).

DavidApril 1st, 2010 at 2:47 am

Looks great. Which font is that?

Tomas RestrepoApril 1st, 2010 at 1:27 pm

@David: It’s Envy Code R, by Damien Guard: http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released

DavidApril 1st, 2010 at 5:50 pm

Thanks

AlexMay 4th, 2010 at 9:56 pm

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!

Tomas RestrepoMay 4th, 2010 at 10:08 pm

@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

Leave a comment

Your comment