I want to give up using mouse for selecting and pasting chunks of text within a buffer. Whats the most efficient way to do this with just kb? I mean navigate to arbitrary line, copy the substring, return to the previous position and paste.
Copying in VimUse the y key on the keyboard when performing this operation. There are a number of yank commands, mainly differing on the amount of text you want to copy. Once in normal mode, move the cursor to the needed place and use the appropriate command. The command stands for “yank till x”.
Press d to cut (or y to copy). Move to where you would like to paste. Press P to paste before the cursor, or p to paste after.
You can use a movement command or up, down, right, and left arrow keys. Press y to copy, or d to cut the selection. Move the cursor to the location where you want to paste the contents. Press P to paste the contents before the cursor, or p to paste it after the cursor.
The command p pastes below the cursor and P pastes above the cursor.
Very simple method:
Shift-V
y
p
at the position you want to.There are of course many other ways to copy and paste, yy
copies the current line for example.
Do the some VIM tutorials, it is better than learning everything bit by bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With