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

Re: Is it possible to remap C-; in zsh?

On Wed, 22 Sep 2010, Mikael Magnusson wrote:

On 22 September 2010 00:18, Derek Thurn wrote:

I'm a fan of remapping Ctrl+Semicolon, since it's conveniently on the home row. However, when I try and map it to something in zsh using bindkey, it doesn't let me. Am I out of luck if I want to bind this useful sequence to a zsh function?

There is no such character as ^; so most terminals just send a ; when you press ctrl-;, this is true of many other ascii chars near that range. If you can rebind the keycombo in your terminal you can bind that in zsh, but that is specific to your particular terminal.

In urxvt you could put this in your x resources:
URxvt.keysym.C-semicolon: \033[50~

After which it can be bound via:

bindkey "\033[50~" widget-name

Just emphasizing that there's still no equivalency of any sort with Ctrl-;

\033[50~ is sort of like the sequence an <F36> key might produce:

F1=\e[11~, F2=\e[12~, F3=\e[13~, ...
(skips after F5, F10, F14, F16),
F18=\e[32~, F19=\e[33~, F20=\e[34~, ...

(I assume '50' was picked for being unlikely to conflict.)


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