Liven it up with color.
November 2, 2009 7:32 AM   Subscribe

Vi/Vim gurus: how can I modify my background color to beautify my gvim interface?

Recently, I've begun using MacVim, the Mac OS X port of the Vim text editor, on Snow Leopard.

The app comes with a feature-complete and sophisticated gui, including a menu for selecting color schemes. You can also configure color schemes via a line in your .vimrc file, which I prefer. Sadly, the schemes are limited to a dozen or so, and none of them float my boat. If I had my druthers, I'd prefer to configure a background like the "darkslategrey" available in the Emacs camp, and use it with white text. (As an aside, this is in no way intended as a pro-Emacs comment; I like both vi and Emacs equally and don't want to ignite a flame war). Another background I'd like to experiment with is "ocean deep".

Is there any way to add a line or two to the .vimrc file to configure more complicated, visually interesting background colors for MacVim like darkslategrey or oceandeep? (I've poked around in the man pages and vi wikis, but can't seem to find the answer). If possible, I'd like to keep things simple, but I'll download a theme file if that's absolutely necessary. Right now, I'm only writing text, so I don't need syntax highlighting. An interesting background color combined with white in the foreground will do the job.
posted by Gordion Knott to Computers & Internet (4 answers total)
 
from the oceandeep.vim I have in my homedir...

highlight Normal gui=None guibg=#103040 guifg=honeydew2

guibg is the directive to enumerate the background color in gvim, guifg the foreground (text) color.

similarly, ctermbg and ctermfg enumerate the colors in a terminal that supports colors.

all colors available to gvim from the vim wiki contains a script that will show you the available colors and their names.
posted by namewithoutwords at 7:50 AM on November 2, 2009


This is a cool preview of (all? most?) of the color themes available on vim.org.
posted by jacquilinala at 8:23 AM on November 2, 2009


You can download and install the "Vim color scheme sample pack", which is 100 color scheme files + a plugin for picking them from your menu bar. You can also type

:colo(rscheme) whatever

to pick your color scheme from the command line. (Put this command, without the :, in your .gvimrc to set it automatically in every window.) You can use the commands that namewithoutwords mentioned to make your own color scheme or modify one that you already have.
posted by k. at 9:41 AM on November 2, 2009 [1 favorite]


(Also, note that .vimrc is for both terminal and GUI; .gvimrc is for GUI only.)
posted by k. at 9:43 AM on November 2, 2009


« Older Save the footnotes   |   Help, I need a stronger wifi signal! Newer »
This thread is closed to new comments.