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

Re: bind key information - filename completion



On Tue, 03 Sep 2013 11:47:08 -0400
Cary Lewis <cary.lewis@xxxxxxxxx> wrote:
> I want to start using the zsh, but my arrow keys (for legacy reasons)
> are not configured in a standard way, and I can't use them to navigate
> the list of files that appears when when attempt to use the filename
> completion features of the shell.
> 
> My question is this: Can I someone configure zsh to use vi style of
> navigation (j is down, k is up, h is left, l is right)?
> 
> I can't just change the key bindings:
> 
>  bindkey "j" up-line-or-history
> 
> because then the j character doesn't work.
> 
> So is there a way to dynamically change the key bindings when the list
> of files is displayed, and automatically change them back?

If I'm following what this is for, it's as simple as


zmodload zsh/complist
bindkey -M menuselect j up-line-or-history
bindkey -M menuselect k down-line-or-history
bindkey -M menuselect h backward-char
bindkey -M menuselect l forward-char


The only disadvantage would appear to be the patently obvious one, that
you can't use those keys to exit the list and immediately insert a
character.

(This is really more of a zsh-users things.)

pws



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