Monday, April 11, 2011

Enable syntax highlight in vi

Open a file, then type the following commands :

:syntax on
:set syntax=verilog

The syntax files are the .vim files, you can use locate to look for it.

Example :

locate verilog.vim

In the directory, you'll see the list of syntax that your vi is supporting.

To make the syntax turn on by default to the language that you preferred, you can edit this file :

vi ~/.vimrc

Put these lines into the .vimrc file.

syntax on
set syntax=verilog

Thanks to YZ shared this tips with me December last year. :)