RE: How do you trap the output of filename completion?
>-----Original Message-----For anyone else out there who is interested, here's an abbrev that will let
>From: Keith Roberts [mailto:kroberts@...]
>Sent: Tuesday, December 02, 2003 10:07 AM
>To: 'Benji Fisher'; 'vim@...'
>Subject: RE: How do you trap the output of filename completion?
>>From: Benji Fisher [mailto:benji@...]
>>Sent: Tuesday, December 02, 2003 6:57 AM
>>Subject: Re: How do you trap the output of filename completion?
>>On Mon, Dec 01, 2003 at 06:26:47PM -0800, Gary Johnson wrote:
>>> On 2003-12-01, Keith Roberts <kroberts@...> wrote:
>>> > [snip]I'd like to trap the output generated by
>>> > the completion so I can :put it into a buffer [snip]
>>> I think the solution to your particular problem would then be:
>This is a step in the right direction. Not *exactly* what I wanted, but I
>can use it. Filename-completion just returns the filenames without the
>path, which is what I was looking for, but it turns out not to make any
>real difference to using 'lid' on <cword>. Plus, it's easy enough to
>delete the paths. Thanks, Gary.
you play with expansions in the "." directory, tossing the matches into a
"new" buffer. Note that it lets you edit the command line before executing
cnoreab %% <C-R>="new\|put!=glob('".expand('#:p')."')"<CR>
And for deleting the paths from the above output for readability:
cmap %f %s+\f*[\\/]++<CR>
[I couldn't figure out how to do both in one step without losing the ability
to edit the pathname being globbed.]