Simon Pamies Sent: Wednesday, December 27, 2006 3:49 AM
>* Suresh Govindachar wrote, On 27.12.2006 12:35 Uhr:
>> Simon Pamies Sent: Wednesday, December 27, 2006 3:19 AM
>>>* Simon Pamies wrote, On 27.12.2006 11:50 Uhr:
>>>>
[...]
>>>
> try the following:
> :b bach <TAB>
> /home/spamies/work/bachl/bsc.cls /home/spamies/work/bachl/bach.tex
>
> It tries to complete the work/bachl directory but I want it to
> complete directly to bach.tex
>
>> Better to do such customizations as a plugin rather than
>> patch the sources.
>
> Thx for the suggestion - I mailed recently with some other
> vim-people that said from themselves to have great experience in
> writing vim plugins and they couldn't help me. So I started to
> adapt sourcecode.
>
> I saw your code and now I'm not so sure anymore that adapting
> sourcecode was such a good idea :-) But I'm not sure if one
> could solve the completion problem (see above) using plugins...
See
help :command-completion
It is not that complicated. Essentially, when user types
:B bach <tab>
your custom completion function will be called with argument bach;
your custom completion function will need to look at the list of
buffers and select those which have bach in their file-name and
return the selected sub-list of buffers.
--Suresh