I use gvim in windows. How to copy text from current position to the end of line in vi and paste it in another file opened in vi. I googled it but cant find any solution for this. Appreciate any help on this. Thank you.
How to copy from current position to the end of line in vi
vivim
Related Topic
- Move entire line up and down in Vim
- Your most productive shortcut with Vim
- Copy all the lines to clipboard
- Git – How to make Git use the editor of the choice for commits
- How does the vim “write with sudo” trick work
- Copy and paste content from one file to another file in vi
- How to exit the Vim editor
- Find and replace strings in vim on multiple lines
Best Answer
The normal-mode command to move to the end of the line is
$
.You can copy to the end of the line with
y$
and paste withp
.To copy/paste between different instances, you can use the system clipboard by selecting the
*
register, so the commands become"*y$
for copying and"*p
for pasting.$
move-to-linebreak$
y$
yank-to-linebreaky,$
"*y$
select clipboard-register yank-to-linebreak",*,y,$
"*p
select clipboard-register paste",*,p
Check
:h registers
for more information.