10

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?

10

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.

8

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.