Pages

Tuesday, February 14, 2012

VI editor (move, delete, copy, paste)


Moving between characters:

If we are writing something and missed a word, pressing backspace will erase the characters that we typed. Instead we can use the following in command mode.

The h key,moves the cursor one character left.
The j key, moves the cursor one character down.
The k key, moves the cursor one character up.
The l key, moves the cursor one character right.
(+& key, moves backward by sentence.
)+& key, moves forward by sentence.


Delete:
To delete something we can do the follwing in command mode.

x key, deletes one character. To delete 10 character once, type: 10x
dw, deletes one word. To delete 10 words once, type: 10dw
dd, deletes one line. To delete 10 lines once, type: 10dd


Copy & Paste:

Press yy to copy / yank a line in command mode and use p to paste it in desired postition.

No comments:

Post a Comment