vim

vim syntax control

I’ve google’ed this one countless times. I’ll store it here
When vim doesn’t recognize what kind of syntax highlighting to use you can set it manually with

: set syn=sh

(in vim command mode)

If you wonder what syntax highlighting modes are available, in Fedora (and I see Ubuntu and Debian got them at the same place) they’re here:

[joar@saturn syntax]$ pwd
/usr/share/vim/vim73/syntax
[joar@saturn syntax]$ ls | sed 's/\.vim//' | head # showing only the first 10 ones
2html
a2ps
a65
aap
abap
abaqus
abc
abel
acedb
ada
[joar@saturn syntax]$ 

FreeBSD got those in /usr/local/share/vim/vim73/syntax/

Vim + headless server + syntax highlighting

After installing my favourite distro, which these days seem to have fallen back on Ubuntu I’m usually installing the ‘vim-gnome’ package. It pulls down the necessary packages for me to have a fully fledged Vim editor with syntax highlighting and so on.
But what if I don’t have X installed ?
Trying to install vim-gnome then would pull down xorg + the complete gnome-desktop environment, which really isn’t that necessary.
Since there’s a lot of packages related to vim it could be a bit confusing which one to pull down just to have syntax highlighting.

# aptitude install vim-nox 

gives you, in _my_ opinion, a working and useful Vim editor in a ‘non-X’ environment :p