Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Adding a prefix to certain filename completions



Bart Schaefer wrote:

> On Jul 4,  9:37pm, Nikolai Weibull wrote:

> > Vim has issues with files that begin with a + (or two +s for that
> > matter), so I'd like to add a ./ prefix to such files when
> > completing.

> YOu can get most of the way there with this:
> 
> zstyle -e ':completion:*:vim:*' fake-files 'reply=("$PWD:$(print ./+*)")'
> zstyle ':completion:*:vim:*' matcher 'b:+=./+'
> 
> However, all that does is offer the ./+* as alternatives, it doesn't
> remove the originals.  The trouble is that file completion is
> sensitive to directory separators, so as soon as you introduce the
> slash, the rules begin to apply to the stuff on the right of the slash
> rather than to the entire string.

Yeah, no...that works, but it wasn't great; damn.

Anyway, thank you all for your suggestions,
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}



Messages sorted by: Reverse Date, Date, Thread, Author