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

    From Hen Hanna@21:1/5 to All on Sun Feb 26 09:17:46 2023
    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.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rbowman@21:1/5 to Hen Hanna on Sun Feb 26 18:28:23 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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hen Hanna@21:1/5 to rbowman on Sun Feb 26 10:49:59 2023
    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. ...............

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hen Hanna@21:1/5 to Hen Hanna on Sun Feb 26 23:47:48 2023
    On Sunday, February 26, 2023 at 10:50:11 AM UTC-8, Hen Hanna wrote:
    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 .




    This works!!!

    https://stackoverflow.com/questions/4620672/copy-and-paste-content-from-one-file-to-another-file-in-vi

    I just found that if you add the following line into your vimrc file,
    then Vim is using the system clipboard.

    set clipboard=unnamed

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)