Wednesday, September 16, 2015

Re: redirect output to a command line

nm, I think I got it:

vim --servername SWILSON --remote-send ':call RedirFile("tabs",
"/dev/pts/57")<CR>'

with:

function! RedirFile(cmd, file)
redir => message
silent execute a:cmd
redir END
let lines = split(message, '\n')
call writefile(lines, a:file)
endfunction

In my vimrc seems to do what I want

On Wed, Sep 16, 2015 at 6:00 PM, shawn wilson <ag4ve.us@gmail.com> wrote:
> I often want to query vim from a command line - so for example:
> vim --servername SWILSON --remote-send ':tabs<CR>'
>
> executes fine and displays the results in vim and i get nothing on the
> command line. I either want a simple shell style redirect (and then
> spit it out to $tty) or redirect to a buffer and save that (though
> having vim save that to /dev/stdout probably isn't going to give me
> the result I want).

--
--
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/d/optout.

No comments:

Post a Comment