Mailing List Archive

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

___________________________

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.


i have these in my .vimrc file.

:ab qq q!

:ab wt w! ~/temp.vi
:ab rt r ~/temp.vi
So i can ..

[1] from one file, do

:.wt -- write 1 line to temp file
:.,.+5 wt -- write 6 lines to temp file
:.,'a wt -- write up to (and including) mark A to temp file

[2] optionally edit the temp file

[3] from another file, do the following to read (in) the temp file

:rt



____________________

> Yes your questions do seem excessively frequent even here on Usenet.
> I have mostly been ignoring them after seeing the first few.


-------- what do you know about USENET ?.... i'm pretty sure i've been posting to USENET longer than you ...

i'm also pretty sure that i've been programming longer than you... (but you may be faster and better.)
--
https://mail.python.org/mailman/listinfo/python-list
Re: Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi [ In reply to ]
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.

--
https://mail.python.org/mailman/listinfo/python-list
Re: Vim (To move text-Lines between files) ___ :ab wt w! ~/temp.vi ___ :ab rt r ~/temp.vi [ In reply to ]
On Sunday, February 26, 2023 at 10:28:41?AM UTC-8, rbowman wrote:
> 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.


thank you... that seems to work... i dont like to split the screen (into Panes) in Vim

Select the text in visual mode, then press y to "yank" it into the buffer (copy)
or d to "delete" it into the buffer (cut).

Then you can :split <new file name> to split your vim window up,
and press p to paste in the yanked text. Write the file as normal.

To close the split again, pass the split you want to close :q .



_________________________________
USENET Nazi said:
Yes your questions do seem excessively frequent even here on Usenet yes.

Usenet-Nazis think they own the Usenet. --------- i'm so GLAD that they don't ! ! !

** The Usenet-Nazi as in .......... "The Soup Nazi" is the 116th episode of the NBC sitcom Seinfeld, which was the sixth episode of the seventh season. ...............
--
https://mail.python.org/mailman/listinfo/python-list