Don't understand german? Read or subscribe to my english-only feed.

zsh: insert-unicode-char

Ever wanted to insert a character in your terminal but don’t have a keybinding for that character? zsh provides a nifty feature called insert-unicode-char:

autoload insert-unicode-char
zle -N insert-unicode-char
bindkey '^Xi' insert-unicode-char

Figure out the character’s code (take a look at unicode.org/charts/ for example) and press ‘ctrl-x i’, followed by the character’s code and press ‘ctrl-x i’ once more. Usage example: ‘ctrl-x i 00A7 ctrl-x i’ will give you an ‘§’.

4 Responses to “zsh: insert-unicode-char”

  1. Bernd Haug Says:

    I don’t want to nitpick (and that’s a shameless lie), but isn’t it weird that (as far as I can see in your example, it doesn’t make a difference between ctrl-shift-x and ctrl-x?

  2. mika Says:

    (AFAIK) the control-key keybindings are not case sensitive in zsh.

    regards,
    -mika-

  3. ft Says:

    Actually, zsh has got nothing to do with this.
    The terminal software creates the same control sequences for C-x as well as C-X.
    If I’m not mistaken.

  4. ion Says:

    Ctrl-Shift-U2665 works in all Gtk apps.