VI editor tips for programmers - 3

In this post we will look at a few settings that are useful while programming.

Syntax coloring 

While typing a program, it is always helpful if various colors are used to higlight different keywords and variables of a program. This
can be acheived by running the command

:syntax on 

While in the command mode in the vi editor.

The screenshots below show the difference.
With out syntax highlighting

With syntax highlighting

Without numbering 

With Numbering and syntax enabled.

Line numbers

A line number can be added to every line in the file by running the command

:set nu
:set number

The screenshots below depict the working of this command

Follow by Email