Enabling colors for C++ in VIM
Can someone give me a rather idiot-proof way of enabling colors in the console version of VIM? I've read through a few "how to" examples and it just isn't working. More specifically, I'd like to have some type of highlighting for C++ as I'm going through these tutorials.
~ Greg |
First try just calling ":syntax on" inside Vim. (Or adding ":syntax on" to the end of your .vimrc file.) If that doesn't do it, then what kind of terminal emulator are your running? If you're using a terminal emulator like xterm, gnome-terminal, or konsole then in most situations it's as easy as setting the TERM environment variable to "xterm-color" and then using ":syntax on" once you're inside Vim.
If syntax highlighting works, but not for C++, I'm not sure what the problem could be. You have to name your source files with a C++ extension like .cpp or .cc but beyond that I don't know. |
Yeah, I have tried that. The ":syntax on" command appears to work as VIM doesn't produce any errors. Also, the terminal emulator that I am using DOES display colors since Ubuntu itself is showing colors for the console prompt, file listings, etc. However, when I open any C++ file (e.g. "test.cpp") there are no colors displayed.
Any ideas? ~ Greg |
All times are GMT -5. The time now is 12:07 AM. |