VI – Visual Editor.
|Command Line||: colon|
Normal –> Insert mode a,i,o,r,s A,I,O,R,S
Esc/Enter –> to normal mode.
: to command line mode.
0<----h * l---->$ ----------------------->M
GG= go to line number
x delete command
X replacement for back space
u undo char by char
U undo at once
DW delete a word
DD delete a whole line
repeat a command 5x will delete 5 chars meaning number specifies number of times the command has to be executed.
|q||quit, vi wont allow if there are any changes done.|
|q!||quit without saving|
|wq||write and quit|
|wq <filename>||save as file name and quit,if file not exists|
|wq! <filename>||save as file name and quit,if file exists|
|r! <Command>||run the command and put the output at the cursor position|
|sh||takes u to shell from vi ,where you can execute commands and come back.|