Tuesday, December 1, 2009

Useful Vi commands

Since last few weeks I've to use VI editor a lot from different platforms. Linux side its OK to use VI as so many developers has contributed and changed a lot things in VI but for other platforms (just few name to - AIX, Solaris) using VI is literally pain. Everytime when I wanted to add, edit, remove characters/words/lines I landed in situation where I've to undo all my changes & had to start the same boring things again. After googling I found VI's cheat sheet which's extremely useful if you're hard core VI fan or if I take it on other way then "If you don't have any choice (like me)". One link which I referred: http://bullium.com/support/vim.html. If you don't wann a scan complete list then few commands must to keep handy:

  • :q! - exit without saving changes
  • :wq! - exit with saving chages //! is for confirmation
  • h - characters to the left
  • l - characters to the right
  • k - line upward
  • j - line downward
  • /pattern - to search forward e.g. /nishit
  • ?pattern - to search backward e.g. ?nishit
  • dd - delete current line
  • :d - delete current line
  • x - delete current character
  • u - undo the change

Keeping alive this blog with new post, where are you folks?