Start
Use command below to open a document. If document not exist, it will create one for temporary until it is manually saved by user (you).
# vi /path/and/document_nameCommand or Insert mode
There are 2 modes in vi / vim : command mode and insert mode. Command mode used to execute vi commands, insert mode is used to edit document. Command mode is the default mode whenever vi / vim is loaded. To use insert mode just press i character. To go back to command mode press Esc button. Whenever you get confused whether you are in command or insert mode just press Esc, this will make go into command mode despite whatever your previous mode is.
All (next) commands is entered in command mode.
Find / Search
To search for string 'document' :
/documentQuit
To save current document :
:wTo quit without saving :
:q!To quit and save :
:qShow Line Number
:set number<< next >>
Futher Readings :
http://www.tech-recipes.com/rx/402/show-line-numbers-in-vi-or-vim/
No comments:
Post a Comment