Setting new default colorscheme for vi(m) in SSH


by: Brooks Swinnerton on March 22, 2010

| Posted in: Blog > Technology



Ever since I started using ubuntu I haven't strayed away from the nano text editor. It's simple to use, quick and efficient. But as I dive further into linux it seems that only the new users use nano over it's much more powerful brother: vim.

I'm starting to switch over to vim, but one of the biggest problems that I have with it is that it's default colorscheme is one heck of an eyesore to stare at all day. There are a few developers out there who have created awesome themes like Hans Fugal's desert theme, but I just couldn't seem to get it to work over an SSH connection.

So here's how I was able to get it working over SSH:

I started by using this edited version of the desert theme, called desert256 and putting it into ~/.vim/colors/

Once you have done this you must make sure that you're using a capable terminal that supports 256 colors rather than the default 16 in SSH. Which can be checked by downloading this perlscript that will show you some colorcubes.

If you get a full range of colors you can move onto the next step: setting the default scheme in vim.

You'll want to fire up you favorite texteditor (it better be vim by now) and edit ~/.vimrc and paste the following:

syntax on
set t_Co=256
colorscheme desert256



And you're done! Next time that you open up vim, it should have a colorscheme looking something like this.




Keywords: Ubuntu, linux, nano, text editor, ssh, vim, vi, colorscheme, desert256, colorcubes



Comment on this article:

Username:   You must login/register to post