HELP: COPY IN VIM

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

HELP: COPY IN VIM

Kunal Chauhan
Hi Team,
Some time I need to copy some text from one vim file and need to copy it in another in same directory. 


1. How can i achieve this?

2. Can I open both file simultaneoulsy and do the copy code from one to another in vim


Thanks
Kunal


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CACEFAc0-UHn3q4SBiZ7dxbyW6WWt%2BzuyFZSWH0BO6dL-kGw3tA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: HELP: COPY IN VIM

Tony Mechelynck
On Sat, May 2, 2020 at 9:48 AM Kunal Chauhan <[hidden email]> wrote:

>
> Hi Team,
> Some time I need to copy some text from one vim file and need to copy it in another in same directory.
>
>
> 1. How can i achieve this?
>
> 2. Can I open both file simultaneoulsy and do the copy code from one to another in vim
>
>
> Thanks
> Kunal

1. See below
2. Yes:

If your Vim is compiled with +windows (which is always the case if
your Vim is at version 8.0.1118 or newer) just open both files in
split-window mode, either by starting Vim or gvim as (for instance)

        vim -o2 filename1 filename2

or (if you already have filename1 open in Vim)

        :split filename2
or
        :new filename2

then yank in the one and put into the other. The fact that both files
are in the same directory is irrelevant here, as long as you can
access them both (and write the changed one) from a single computer.
(Either filename1 or filename2, or both, can be a full
path-file-name.)


Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXvLza5mR33qbwkF6a7exvz079yfVSuDwSkTDYWi0Ch6VA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: COPY IN VIM

Chris Willis
From: Tony Mechelynck
Sent: Saturday, May 02, 2020 9:26 AM
To: Kunal Chauhan
Cc: vim_use
Subject: Re: HELP: COPY IN VIM

On Sat, May 2, 2020 at 9:48 AM Kunal Chauhan <[hidden email]>
wrote:

>
> Hi Team,
> Some time I need to copy some text from one vim file and need to copy it
> in another in same directory.
>
>
> 1. How can i achieve this?
>
> 2. Can I open both file simultaneoulsy and do the copy code from one to
> another in vim
>
>
> Thanks
> Kunal

1. See below
2. Yes:

If your Vim is compiled with +windows (which is always the case if
your Vim is at version 8.0.1118 or newer) just open both files in
split-window mode, either by starting Vim or gvim as (for instance)

        vim -o2 filename1 filename2

or (if you already have filename1 open in Vim)

        :split filename2
or
        :new filename2

then yank in the one and put into the other. The fact that both files
are in the same directory is irrelevant here, as long as you can
access them both (and write the changed one) from a single computer.
(Either filename1 or filename2, or both, can be a full
path-file-name.)


Best regards,
Tony.

--
Hi Kunal

you will also need to know how to move between the windows. That's CTRL + w
followed by a cursor key ( or CTRL + w followed by one of hjkl (for
horizontal splits as described by Tony, one of jk)).

Chris

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3DD6F01E53C8409F9583F5C8008C62AD%40ChrisPCW7.
Reply | Threaded
Open this post in threaded view
|

Re: COPY IN VIM

Tony Mechelynck
On Sat, May 2, 2020 at 11:15 AM 'Chris Willis' via vim_use
<[hidden email]> wrote:

>
> From: Tony Mechelynck
> Sent: Saturday, May 02, 2020 9:26 AM
> To: Kunal Chauhan
> Cc: vim_use
> Subject: Re: HELP: COPY IN VIM
>
> On Sat, May 2, 2020 at 9:48 AM Kunal Chauhan <[hidden email]>
> wrote:
> >
> > Hi Team,
> > Some time I need to copy some text from one vim file and need to copy it
> > in another in same directory.
> >
> >
> > 1. How can i achieve this?
> >
> > 2. Can I open both file simultaneoulsy and do the copy code from one to
> > another in vim
> >
> >
> > Thanks
> > Kunal
>
> 1. See below
> 2. Yes:
>
> If your Vim is compiled with +windows (which is always the case if
> your Vim is at version 8.0.1118 or newer) just open both files in
> split-window mode, either by starting Vim or gvim as (for instance)
>
>         vim -o2 filename1 filename2
>
> or (if you already have filename1 open in Vim)
>
>         :split filename2
> or
>         :new filename2
>
> then yank in the one and put into the other. The fact that both files
> are in the same directory is irrelevant here, as long as you can
> access them both (and write the changed one) from a single computer.
> (Either filename1 or filename2, or both, can be a full
> path-file-name.)
>
>
> Best regards,
> Tony.
>
> --
> Hi Kunal
>
> you will also need to know how to move between the windows. That's CTRL + w
> followed by a cursor key ( or CTRL + w followed by one of hjkl (for
> horizontal splits as described by Tony, one of jk)).
>
> Chris

Yes. Or Ctrl-W w goes to the next window (round-robin) in displayed
sequence, Ctrl-W W to the previous one (but either of them with a
count go to the nth from top, not the nth from where you are), and
mouse-clicking in any window or on its status bar goes to that window.

So if there are only two split-windows, Ctrl-W w (or, if your thumb
moves slowly, Ctrl-W Ctrl-W) goes from either one to the other.

Happy Vimming!
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsgwowD8c4m7m98a4Cn4pnj3fG-QvvsfAG%3DQYny4cWrXA%40mail.gmail.com.