More than 8 Color Vim Syntax Highlighting in GNOME Terminal
filed in Uncategorized on Jun.27, 2009
Matt Wozniski wrote an awesome little Vim plugin called CSApprox that lets Vim transparently apply GVim colorschemes in the terminal. CSApprox works by approximating the color in the GVim colorscheme to the closest availble color in your terminal, provided that your terminal supports either 88 or 256 colors.
After downloading the plugin zip and extracting it to the ~/.vim directory, I was met with a rather disappointing message:
CSApprox skipped; terminal only has 8 colors, not 88/256 Try checking :help csapprox-terminal for workarounds
Don’t worry, GNOME Terminal isn’t actually limited to 8 colors, it just evades detection. We can easily force 256 color support by setting the t_Co option in ~/.vimrc .
1 | set t_Co=256 |
Here is a screenshot of the GVim colorscheme jellybeans.vim running inside of GNOME Terminal.
Pretty. No?
Edit: I need to make a minor retraction: jellybeans.vim already supports 256 color terminals, so we’re only seeing the effect of set t_Co=256 here and not CSApprox. In demoing this I picked the nicest scheme I had for GVim, not realizing it already supported 256 color vim. Enjoy anyway =).

June 30th, 2009 on 8:53 pm
This is very very useful. I just applied it on my work machine, and now my color schemes are much more pleasing.
June 12th, 2010 on 10:36 am
Thanks indeed. Never actually cared about that, but lately I was thinking about having darker themes in Vim; and prefer having a proper shell (:sh) at hand than using gVim
July 3rd, 2010 on 10:12 pm
Thank you, thank you, thank you, sir!!!!!!!!