Tuesday, February 23, 2016

VIM editor useful shortcuts

Obviously, these little shortcuts will save your time.
Following shortcuts should be used in escape mode (After pressing  Esc).

Task Key
Create a new line above current line SHIFT + O
Create a new line below current line
Copy current line or selection SHIFT + Y
copy a line yy
Paste after cursor p
Paste before cursor SHIFT + P
Delete a line dd
Start selecting lines (start Visual mode linewise)
*Then use arrow keys to 
-select other lines
SHIFT + V
Jump to end of the line SHIFT + A
or $
Jump to beginning of the line SHIFT + I
or 0 (zero)
*have slightly difference
Undo (step by step) by pressing U
Indent right >
Indent left
*You can indent single line or selection of lines too
<
*press "." to repeat any task. For example: press dd to delete a line and then press "." to continue deleting line by line.

4 comments: