Well it turns out that theproblemis a little more subtle than that. It is only therootuser that does not have syntax highlighting.

You see, vimdoes 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.bashrcat /root/.bashrc :

aliasvi='vim'

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. 🙂