Thursday, March 12, 2009

VIM Editor Cheat Sheet

We all use VIM editor and we love it, but most of us don't know there are lots of cheat commands which are really useful. Do explore the VIM world and enjoy editing
Visual mode allows several commands to be run in conjuction with it. To use it type 'v' then move the cursor, this will create a highlighted block of text. In the windows version of gvim, you can use the mouse to select blocks of text. I prefer to use 'V' which is line based visual mode.

Here are some commands commonly used with visual mode.

  • > shift the block right one shiftwidth
  • <>
  • = reindent the block
  • y yank ( copy ) the block ( paste with a p )
  • d delete the block
  • c change the block