VI Editor Command Reference

Note: Commands below are case sensitive and may not work on all versions of VI editor.

General Commands To use VI

  1. vi filename to open file
  2. ZZ or :wq To exit vi and save changes
  3. :q! To exit vi without saving changes
  4. [esc] To enter vi command mode

Cursor Movement Commands

  1. h move left (backspace)
  2. j Move down
  3. k Move up
  4. l Move right (Spacebar)
  5. [return] move to the beginning of the next line
  6. $ last column on the current line
  7. 0 move cursor to the first column on the current line
  8. ^ move cursor to first nonblank column on the
    current line
  9. b move cursor back by one word
  10. w move cursor forward by one word

Other settings

  1. Esc : set number shows line numbers
  2. Esc : set nonumber disables line numbers
Advertisements

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: