vi no syntax highlight in CentOS?

Well it turns out that the problem is a little more subtle than that. It is only the root user that does not have syntax highlighting.

You see, vim does have syntax highlighting but vi and vim are different binaries. A shell startup script only aliases vi to vim if the user id is higher than 100 – which excludes root. The simplest workaround is to just add an explicit alias to root’s .bashrc at /root/.bashrc :

alias vi='vim'

run the command manually or just log in again to “activate” the alias.

Btw, I’m starting to like vi… a lot. For a long time it made no sense to me – but now I am found. :)

  • Share/Bookmark
This entry was written by Tricky , posted on Friday June 05 2009at 12:06 am , filed under linux and tagged , , , , , , , , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

One Response to “vi no syntax highlight in CentOS?”

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">