vi editor : the ultimate cheat sheet
For beginners in UNIX, vi editor is a source of frustration. Typically users being their UNIX journey with vi, give up on it in the first week or two and flee to emacs, pine and other sort of editors.
For Command Mode type “Esc”
For Insert Mode type “a”
For Visual Mode type “v”
For Line Mode type “:”
you wanna …. |
this is how u do it notepad
|
this is how you do it in vi |
type text | just type | insert mode + type |
undo | NA |
command mode + u
|
move your cursor up left down right | use arrow keys | insert mode + use arrow keys |
page down | use page down key |
insert mode + use page down key but if this doesn’t work try ctrl f
|
page up | page up key | insert mode + page up key but if this doesn’t work try ctrl b |
delete character |
delete key
|
insert mode+ delete if it doesn’t work go for command mode + x
|
backspace | backspace | insert mode + backspace |
highlight some area | use mouse | visual mode + use cursor |
copy the highlighted text | highlight the area with the mouse and press ctrl c to copy highlighted area | visual mode + use cursor to select the area that needs to be copied and press ‘y’ key |
cut the highlighted text | ||
delete the highlighted text | highlight the area with the mouse and press the delete key to delete the highlighted aea | visual mode + use curor to select the area that needs to be deleted and press ‘d’ key |
paste what ever is in the clipboard | ctrl v | p |
find text | ctrl f … type the text in the find window… | /text or ?text |
quit file | line mode + q . If no changes it will silently quit. Other wise it says use q! or wq | |
quit file without saving changes | just close the window …. | line mode + q! |
quit file by saving changes | ctrl s + close the window | line mode +wq |
Leave a Reply