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

Re: Adding a prefix to certain filename completions



On Jul 4,  9:37pm, Nikolai Weibull wrote:
} Subject: Adding a prefix to certain filename completions
}
} 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.

You'd be better off if there were some other way to protect the + from
interpretation by vim.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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