Saturday, May 2, 2020

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.

--
--
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/CAJkCKXvLza5mR33qbwkF6a7exvz079yfVSuDwSkTDYWi0Ch6VA%40mail.gmail.com.

No comments:

Post a Comment