Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi

rbowman bowman at montana.com
Sun Feb 26 13:28:23 EST 2023


On Sun, 26 Feb 2023 09:17:46 -0800 (PST), Hen Hanna wrote:


> To move text-Lines between files --- i do this (below)....   Maybe
> there's a better (or more standard) way,  but i've been doing this for
> 30+ years, so i'll prob.  keep doing it.
>

You can use the buffers. 

"a yy  will add the current line to buffer a.

"A 5 yy  will add 5 lines to buffer a. Note the use of case.

"a p  will write the contents of buffer a to the other file. 

Note that buffer a does not interfere with using a for a bookmark. In 
other words if you've marked an area with 'm a',  "a y'a  will put the 
text from the current position to the bookmark in buffer a.

Also note that "* p  will insert the contents of the clipboard or copy the 
text to the clipboard. I use that if I have files open in two different 
gvim instances.



More information about the Python-list mailing list