Saturday, December 29, 2012

Re: Capture output of command line completion in script

Christian Brabandt wrote:

> On Mi, 26 Dez 2012, Bram Moolenaar wrote:
>
> >
> > Christian Brabandt wrote:
> >
> > > On Di, 25 Dez 2012, Luca Pette wrote:
> > >
> > > > On Saturday, 26 March 2011 00:10:52 UTC+1, Rickard Lindberg wrote:
> > > > > Hi,
> > > > >
> > > > >
> > > > >
> > > > > If I type CTRL-D on the command line it will show a list of possible
> > > > >
> > > > > matches (:e foo<CTRL-D>).
> > > > >
> > > > >
> > > > >
> > > > > Is it possible to capture this result list in a vim script?
> > > >
> > > > I was searching for this too. Any new suggestion? It would be
> > > > awesome if it would be possible to capture the output of command
> > > > line completion with vimscript/
> > >
> > > Bram,
> > > here is a patch, that enables redirecting when using <ctrl-d> for
> > > commandline completion:
> >
> > Hmm, I wonder why this request was made. Wouldn't it be more useful to
> > add a Vim script function to access the completions?
>
> Right. But shouldn't :redir also be useable to capture all available
> completions? We can still think about adding another completion
> vimscript function for returning all matches.

That depends. If someone uses :redir to capture the result of a
command, then the list of completions just gets in the way. Generally,
redirection is to capture the output of the command, not what was done
to edit it. We could perhaps add a flag to :redir to also capture
everything that was typed and displayed, but that's getting complicated.
With a Vim funtion it should be a lot easier and straightforward to get
what you want.

--
hundred-and-one symptoms of being an internet addict:
206. You religiously respond immediately to e-mail, while ignoring
your growing pile of snail mail.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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

No comments:

Post a Comment