On Apr 9, 6:29 pm, Tim Chase <[email protected]> wrote:
> On 04/09/2011 12:11 PM, Spiros Bousbouras wrote:
>
> > How can you insert the output of an Ex command into the buffer
> > at the place where the cursor is ? Say for example in the 1st
> > line here I want to insert right after "you" the output of
> > :chdir .So I place the cursor after "you" and then do what ?
>
> A couple options occur:
>
> 1) use :redir to a register and paste the register contents:
>
>    :redir @a
>    :chdir
>    :redir END
>    "ap

Strange that there isn't a simpler method built-in. And of
course if there is already a redirect going on this will mess
things up.

> 2) use the system() call in an expression-register to perform the
> command in your OS's command-interpreter:
>
>   In insert mode in *nix:
>   ^R=system('pwd')

I'm on Linux. This works for my specific example but not for
arbitrary vim commands. For example it won't work for
:swapname .

[...]

-- 
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

Reply via email to