It seems that the problem is not in vim as such. The problem is with the terminals I use. According to the VIM documentation , the terminals I used, vt100 and xterm do not support colors! And therefore there are no colors in vim either!
But, to my surprise, on another server, xterm seemed to support 8 colors. I found this by running /usr/bin/tput colors , which printed -1 on a server where there were no colors and 8 on a server that supported colors.
Thanks to @Idigas for related pointers!
source share