The following are commands I find useful when editing in VIM. To make a particular command permanent, add it to your .vimrc file.
To use the indent from the previous line.
:set autoindent
Turn on syntax highlighting.
:syn on
Set the make program for PHP development.
:set makeprg=php\ -l\ % :set errorformat=%m\ in\ %f\ on\ line\ %l
Now, \\:make
will execute and show any errors.
To set your tab stop size to 4.
:set tabstop=4
To set the indent width (not sure how this differs from tabstop described above).
:set shiftwidth=4
To insert spaces instead of tab characters when you hit tab you can:
:set expandtab
To change all existing tabs to spaces, use the following.
:retab
To edit in a new tab.
:tabe
Then, to switch to the next/previous tab use gt or gT.
To complete the current word, press CTRL-X, CTRL-O.