Wednesday, January 14, 2009

vi Editor Commands

vi editor is the oldest text editor, I'm used. It's very simple editor, although it has limitation. You can run on command line. Sometime I used mcedit editor to replace vi editor, because the colors.

Code :
$ vi

General Startup :
To use vi: vi filename
To exit vi and save changes: ZZ or :wq
To exit vi without saving changes: :q!
To enter vi command mode: [Esc]

Commands you must know :
i start edit or insert character
:q exit
:wq save changes and exit
:x save changes and exit
:w save changes without exit
:q! exit without save changes
Esc A to end of line
Esc o insert a line below the cursor
Esc O insert a line upper the cursor
dd delete a line
4dd delete 4 lines simultanously

Note :
[Esc] is Escape button
by.msmunir@batan.go.id

No comments:

Post a Comment