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

Re: Troublesome Key Bindings

On Mar 14, 10:44am, Peter Stephenson wrote:
} Subject: Re: Troublesome Key Bindings
} "Zvi Har'El" <rl@xxxxxxxxxxxxxxxxxxx> wrote:
} > I am using zsh in vi insert mode (being an fanatic ViM user). After
} > doing compinit, which introduced many new key binding, I started
} > having troubles in history searches: Although most of the new
} > bindings have the prefix ^X, there are three with a prefix ^[, i.e.,
} > the escape character. These are
} > 
} > 	"^[," _history-complete-newer
} > 	"^[/" _history-complete-older

These two bindings come from the #compdef line in _history_complete_word.
I don't recall why those keystrokes were chosen, but they're certainly
bad for vi mode.

There are a number of things we could do ... the most obvious would be to
simply remove the #compdef from _history_complete_word (replace it with
#autoload).  Better perhaps would be to add -e and -v options to compdef 
to specify the keymap in which the binding is to take place, but it might
be hard to come up with an unambiguous syntax for specifying different
bindings in the two modes with the same #compdef.

} So for the first two, you can simply use bindkey to map them to something
} else straight away:
}   bindkey '^X/' _history-complete-older

Of course you also need to "bindkey -r" the old binding, as you're already

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