Monday, November 9, 2009

vi colors : Open Solaris

vi colors
When I edit a text file in vi, I find it much easier to read if the syntax is color highlighted. There are 2 steps to enabling this. First, add an alias for vi (or vim) to your ~/.bashrc file as follows:

#
# Enable color support for vi
#
alias vi='TERM=xtermc vim'
You can read the gory details about why this needs to be done in bug 1641 - xterm terminfo entry doesn't support color.


You also need to tell vi to use syntax coloring. Adding the following to your ~/.vimrc file (create one if it doesn't yet exist):


syntax on

No comments:

Post a Comment