Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim syntax Highlighting

I have installed vim in Debian 6. I am trying to change color scheme and enable syntax highlighting. But it's not working. I added set background=dark in .vimrc file. But white background is displaying. I wonder what went wrong?

Here is my .vimrc file: http://pastebin.com/8k2gpWDh

I installed robokai colorscheme which has dark background. But the background looks white instead dark. Other colors of colorscheme working.

like image 430
blakcaps Avatar asked Jun 10 '11 16:06

blakcaps


2 Answers

Make sure you have

syntax on

And then call

color[scheme] {name}

To set your desired colorscheme. These contain the set background=dark you refered, so it should be a matter of choosing the right one. Vim comes with some color schemes, but you may want to install new ones.

This page and this one provide tips on color schemes, and there is a test page very helpful when choosing colorschemes.

like image 132
sidyll Avatar answered Oct 15 '22 20:10

sidyll


robokai seem to be written for a 16 color terminal, a linux console probably, but i am guessing here. To make it work if you are using a terminal emulator (like xterm, gnome-terminal, konsole, etc) you may use set t_Co=16 before loading the color scheme or force your terminal type to linux when running vim (TERM=linux vim ...), and manually set a dark background in your terminal emulator,

Also run dpkg --get-selections | grep vim. For vim to work in full you need to see one of: vim-gnome, vim-gtk, vim-lesstiff or vim-nox (for systems without a graphical desktop).

like image 30
Pablo Castellazzi Avatar answered Oct 15 '22 20:10

Pablo Castellazzi