Friday, October 27, 2006

GNOME-Terminal Vim with 256 Colors

All this time I've been using Vim in 8 color mode assuming that my terminal (gnome-terminal) didn't support anything better. Well when using libvte version 0.13.0 or newer, it can support up to 256 colors! To pull this off in Vim is actually quite simple. You just need to tell Vim that your terminal can handle it, then use an appropriate colorscheme that takes advantage of the extra terminal colors. Telling Vim is as easy as set t_Co=256. After that download a colorscheme like desert256 to make it look all pretty-like.

Modified desert256

There's a screenshot of my Vim, running in the terminal, using a modified version of desert256. The only modifications I made were to tone down the comments a bit (from cyan), and to alter the omni-completion menu from face-melting hot pink. If I didn't know better, I'd think that was GVim :)

4 comments:

  1. Thank you! This is most excellent. Now I can use "Zenburn" with regular vi (instead of using gvim)!

    ReplyDelete
  2. Hi, I've tried the same to no avail. Term colors is 256 but the appearance in vim is not what I get in gvim.

    ReplyDelete
  3. gabriel, you need a theme designed for 256 colors.

    ReplyDelete
  4. Just thanks

    ReplyDelete