Vim editor - Copy text in vim, delete line in vim |
VI Text Editor - Editing shortcuts
In this topic we use vim command which will provide a powerful editing
for example we have to edit text before the cursor, append text at the
end of the line, add new line above and below the cursor, replace, join
and so fourth...
For the action we will first press "ESC" Key for command mode from the keyboard and then press below key
To Insert text before the cursor
iTo Insert text at the beginning of the line, suppose we are in the middle of line and want to insert text at the beginning
I
To Append the text after the cursor
aTo Append the text end of the line
ATo Open new line below the cursor
o
To Open new line above the cursor
O
To Copy the word
yw
To Copy the line
yy
Copy the N number of line, like copy 10 lines
10yy
To paste after cursor position
p
To paste before cursor position
P
Delete character from cursor position
x
Delete previous character from cursor position
X
To delete word from cursor position
dw
To Delete entire line from cursor position
D
To delete line
dd
To delete the N number of line, for example 10 line
10dd
To delete everything from file
:%d
To Cut the line
c
To cut the line after the cursor
C
To replace text after the cursor
R
Thanks you !!
I hope this topic gave you all the information you needed. If you have any further questions or would like more detailed directions feel free to contact us using any of the following sources.We look forward to talking to you.