On Apr 10, 7:47 pm, Tim Chase <[email protected]> wrote:
> On 04/10/2011 05:39 PM, Spiros Bousbouras wrote:
>
> > 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?
>
> >> 1) use :redir to a register and paste the register
> >> contents:
>
> > Strange that there isn't a simpler method built-in.
>
> I'm not sure it's *that* strange -- using ":redir" is the
> canonical way to access the messages Vim produces, and Vim gives
> plenty of options for redirection (files/registers/variables, and
> appending/overwriting).

Still , it's less convenient than system() so vim makes it
easier to get the output of external commands than vim
commands.

> I could see adding a hist-names (":help
> hist-names") entry for messages to allow access to the
> message-history list which would then allow you to insert it via
> something like ^R=histget('messages')

I would prefer a vsystem() function (vim system) or whatever
you want to call it so that for example you could do
^R=vsystem("swapname")

> That said, I could count on one hand[*] the number of times in 10
> years of using Vim that I've wanted to include the output of a
> vim command in my text, and

Ahhh , but perhaps your brain subconsciously filtered out such
possibilities because it realised that it's not easy to do  ;-)

[...]

> [*] okay, it might be cheating that I often count in binary on my
> fingers, but that's still less than 32 :)

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