Cursor Movements
h, j, k, l | Move left, Down, Up, Right |
0 | Move to First Character of the Line |
$ | Move to end of Line |
w | Move to next word |
CTRL + D | Move Page Down |
CTRL + U | Move Page Up |
G | Move to the End of File |
1G or :1 | Move to the Top of File |
nG | Move to Line number n. (replace n is any integer value) |
CTRL + G | Display current Line Number |
Find a Text
/text | Find a text in Forward Direction |
?text | Find a text in Reverse Direction |
n | Repeat the previous Search |
Note: text needs to be replaced by the string that needs to be searched.
Editing, Inserting orDeleting a Text
a | Append after Cursor |
A | Append to the end of Line |
i | Insert before cursor |
I | Insert from the Beginning of the line |
o | Insert a new Line in the edit mode |
cw | Change word |
cc | Change whole line |
C | Change text to end of line |
dd | Delete Current Line |
5dd | Delete current line and next 4 |
D | Delete from Current Position to the end of line |
u | Undo last change |
U | Restore Current Line |
Copy(yanking) and Paste
yy | Yank a copy of Current Line |
p | Insert previously yanked Line |
Saving and Exiting
ZZ or :wq | Save and exit file |
:q! | Exit without Saving |
:w filename1 | Save edited file as filename1. Similar to Save as. |
No comments:
Post a Comment