1. Create a .vimrc in your $HOME directory:
2. Put all the statements in it:
Now syntax highlighter and numbering should be on.
Above is how my .vimrc looks like.
- set nocompatible
This setting prevents vim from emulating the original vi's bugs and limitations.
- set autoindent
The first setting tells vim to use "autoindent" (that is, use the current line's indent level to set the indent level of new lines). The second makes vim attempt to intelligently guess the indent level of any new line based on the previous line, assuming the source file is in a C-like language. Combined, they are very useful in writing well-formatted source code.
- set showmatch
This setting will cause the cursor to very briefly jump to a brace/parenthese/bracket's "match" whenever you type a closing or opening brace/parenthese/bracket. I've had almost no mismatched-punctuation errors since I started using this setting.
- set ruler
This setting ensures that each window contains a statusline that displays the current cursor position.
- set nohls
By default, search matches are highlighted. I find this annoying most of the time. This option turns off search highlighting. You can always turn it back on with :set hls.
More info can be obtained from Google : )