Related Articles

vi

Print PDF

Turn on color syntax highlighting

Open file (for example file.c):

$ vi file.c

 

Now press ESC key, type : syntax on
:syntax on

Task: Turn off color syntax highlighting


To turn it back off, press ESC key, type : syntax off
:syntax off

You can edit ~/.vimrc file and add command syntax on to it so that next you will start vim with color syntax highlighting option

 

$ cd
$ vi .vimrc

Append the following line:

syntax on

Save and close the file.

 

Related Articles+