Thursday, June 13, 2013

Re: Sending buffer to Vim server

On 19:16 Thu 13 Jun , Claus Atzenbeck wrote:
> Hi all:
>
> I start appreciating Vim's server capabilities: "vim --servername vim",
> followed by "vim --remote" from another terminal.
>
> Now, imagine that I have 2 instances of Vim running, of which one has
> been started as a Vim server.
>
> Is there a way to push a Vim buffer from one instance to the Vim server?
> (This would be directly from within Vim, *not* by calling "vim --remote"
> from command line)?
>
> (( Explanation why I'd like to have that: I have Vim server running. In
> addition to that, my e-mail application starts new instances of Vim for
> typing e-mail messages. Sometimes, I'd like to copy text from buffers
> open in Vim server. Certainly, I could save them and re-open them in my
> mail's Vim instance, however, it would be more efficient to push a
> buffer to Vim server, change it there and push it back to my mail's Vim
> instance. ))
>
> Any hint is appreciated.
>
> Best,
> Claus

You cannot send buffers to a server. But you can read buffers: just use
:edit filename, and when vim detects that there was a change choose
[R]eadonly. Alternatively you can write a function which ask the
server for a buffer's contents and puts it to new buffer in the 'email'
instance of vim.

Best regards,
Marcin

--
--
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.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: