Saturday, May 2, 2020

Re: COPY IN VIM

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 <atkunalchauhan@gmail.com>
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3DD6F01E53C8409F9583F5C8008C62AD%40ChrisPCW7.

No comments: