ctrl c v in linux
How to ctrl-c-v in the vim
ctrl c v is the best tools for us!
So how to use it in the vim, as we all kown, ctrl +[]
is used by vim in other place.
cv within the vim
If you just wants to use it in the vim, it is simple
copy
command | usage |
---|---|
y | choose the content in the v mode and copy it |
yy | copy the current line |
nyy | copy n lines from the current line |
y_ | it is equal to the yy |
yw | y the word |
y$ | copy until the end of the line |
y^ | copy until the blank |
y0 | copy until the begin of the line |
y[n]G | copy until the 20th line |
yG | copy until the end of the file |
y?[n] | copy until the place the bar appear |
paste
paste is easy, p will paste after the cursor while
P will paste before the cursor.
cv beyond the vim
emmm…
Then we are going to the magic -“register”
Don’t be scared, it is not the register in the asm.
Then vim provides many registers for us to use.
input the :reg
in the vim you will see it.
It may be various to people.
Then you should check whether your vim support the clipboard
1 | vim --version|grep "clipboard" |
if it show -clipboard, you should install vim-gtk from the terminal
Then copy something outof the vim and then see it
in which reg in the vim. You can know which reg is used
by the system.
Then you can use the "[reg name] + copy operation
All are the same, just the text is storaged in the
reg.
The paste is the same regname + operation .