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

Re: correct paths by prefixing them with '.'



On Feb 13,  2:02pm, kba wrote:
} 
} When I'm in $HOME, enter 'cd vim<tab>', can zsh correct that path to
} '.vim'? If so, how do I enable it?

The simplest way is to find the place in your ~/.z* startup files where
the completion system is loaded, which should look something like this:

autoload -U compinit
compinit

and then below that add the line

_comp_options+=(globdots)

If that has undesired side-effects for other completions, then there's
a hack that might work:

zstyle -e ':completion::complete:cd::paths' expand 'setopt globdots'

If you already have a setting for the "expand" style in that context
(for example, it might be "prefix" like so:

zstyle ':completion::complete:cd::paths' expand prefix

or it might be "suffix") then change the above to store the current
setting into the REPLY variable, like this:

zstyle -e ':completion::complete:cd::paths' expand \
	'setopt globdots; REPLY=prefix'

Note the difference in those zstyle commands with respect to teh -e
option.



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