vim and syntax highlighting

On November 25, 2010, in howto, by nate

Syntax highlighting is a sysadmin’s dream, it allows you to code more efficiently or easily parse through relevant information in config files. To get vim syntax highlighting to work in Lenny, you first need to install vim – as the base version (vim-tiny) does not support syntax highlighting.

# aptitude install vim

Then edit /etc/vim/vimrc and go to line 20 and remove the quotation in front of ‘syntax on’ so it looks like this:

# vi /etc/vim/vimrc
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well

Finally save by hitting ‘:’ and type ‘x’ then enter. (There are many ways to save and quit in vim, such as replacing the ‘x’ with ‘wq’ or just simply hitting ‘ZZ’)

Tagged with:  

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*