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

Re: bindkey and widgets

    Hi David :)

 * Davilín <david@xxxxxxxxxxxx> dixit:
> It is possible to map the "Ctrl+RePag" combination using bindkey?

    No. If you want to use 'Ctrl+RePag' combo you must edit your
/etc/keymap and modify the lines that bind that combo to the
scrollback facility under Linux. You should bind them to a string:

string F20 = "\033[98~"
string F21 = "\033[99~"
keycode 104 = PageUp   F20
keycode 109 = PageDown F21

    The above will generate sequences so if you press 'C-PgUp' or
'C-PgDn' you will send '\e[98~' and '\e[99~'. You can bind them under
Zsh using bindkey:

    bindkey -s "^[[25~" " |\$pager\n"

    is what I use to bind that... well, key, at the right of the
infamous WinDOS logo, at the right side of my keyboard (in my
/etc/keymap file I have that key generate '^[[25~').

> On the other hand, how can i map one action with two widgets?

    See Bart's message for that. Is a very good explanation :) IMHO
the easiest one if you don't want to create new widgets is the one I
told you yesterday: bind some strange key combo to each widget and
after that use bindkey to bind your usual 'kill-line' combo to the
string corresponding to the two strange key combos (in Bart's
explanation, they are '\e{' and '\e}')

    Nonetheless, if you plan to make something more complicated in
the future regarding kill-line (e.g. adding more widgets to run after
kill-line, making the killing depending on the contents of the
$BUFFER, etc.) I encourage you to create a new widget. Is pretty
straightforward (if I can do it, anyone can XDD) and very, very
powerful ;)

    Have fun with Zle :)

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/

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