vim is a modal text editor
Vi epitomises all that is great about the UNIX way of thinking. It has a very steep learning curve and without takling time to learn the commands a new user would get lost very quickly. However, with a bit of effort you will soon have the most powerful and efficient text editor at your fingertips.
See here for a vi command reference.
See here for a vim cheat sheet.
- Use the
%key to jump to a matching bracket.
set noautoindentto prevent indentation problems when pasting into vim.
set fileformat=unixto remove DOS CR characters.
set background=darkwhen using vim in a terminal with a dark background.
:g/^\s*$/d # delete all blank lines :g!/string/d # delete lines not containing string :g/fred/,/joe/d # delete across lines