Thursday, January 8, 2009

[vi] Basic vi command

See below the basic you should (me anyway) need to get started with vi.
I usually use vim(vi improved) but in some Sun servers, you may have only vi available.
  • h
Move the cursor to the left one character position
  • j
Move the cursor down one line.
  • k
Move the cursor up one line.
  • l
Move the cursor to the right one character position.
  • X
Delete the character before the cursor.
  • x
Delete character under the cursor. A count tells how many characters to delete. The characters will be deleted after the cursor.
  • a
Enter insert mode, the characters typed in will be inserted after the current cursor position. A count inserts all the text that had been inserted that many times.
  • i
Enter insert mode, the characters typed in will be inserted before the current cursor position. A count inserts all the text that had been inserted that many times.


You can find the above here

No comments: