When I write a script in gedit, the commands, comments, variables etc... are given different colors. How do I setup vim to do the same?
-
Check out this question: vi.stackexchange.com/questions/3882/… – ankush981 Jul 10 '15 at 9:41
vim has an extensive support for syntax highlighting and typical distributions contain a number of highlighting rules. For enabling this you have to switch the syntax module on using :syntax on
in your vim session or globally your .vimrc
file.
See vim help on syntax for details.
Try :syntax on
.
To have syntax highlighting enabled by default, add the following line to your ~/.vimrc
:
syntax on
If the file doesn't exist, create it.