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

Much nicer:



Comments:

Yes, it works, but unfortunately it messes up Midnight Commander, and I have to set it up back to "xterm" any time I need to call mc.

Posted by shmerl on October 08, 2009 at 08:28 PM GMT #

OK. The updated solution using an alias should solve that problem.

Posted by Brian Leonard on October 08, 2009 at 11:51 PM GMT #

nice

Posted by 67.243.172.141 on October 19, 2009 at 11:51 PM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Roman Strobl