set term=builtin_ansi
syntax on
Few of tips for beginners like me:
To start coding in vim
press <i> key and you are in insert mode to start writing
To exit text insert mode press Esc key and press colon key for :
now
to save
: w
to enable line number
:set number
if line number don't show up for already open text or any file. type
:ex
you will enter ex mode then type
:visual
you will return in visual mode and you will see line number of previously typed set number command, to hide line number type
:set nonumber
Strip out the DOS line endings '^M' is to use the ff option:
:set ff=unix
:wq
Now your file is back to the good-old-Unix-way.
If you want to add the DOS line-endings (to keep a printer happy, or transfer files with Windows friends who don't have nice tools) you can go the opposite direction easily.
:set ff=dos
:wq
search and replace a word
:s/searchWord/replaceWith/g
search and replace a word every occurrence in file.
:%s/seachWord/replaceWith/g