Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active December 12, 2023 17:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YumaInaura/50c2d6e5e3c13b96ffaa64216873747a to your computer and use it in GitHub Desktop.
Save YumaInaura/50c2d6e5e3c13b96ffaa64216873747a to your computer and use it in GitHub Desktop.
Zsh / Zle — Bindkey escape sequences ( backspace / escape / carriage return and others )

Zsh / Zle — Bindkey escape sequences ( backspace / escape / carriage return and others )

Popular used keys

\r
carriage return

\e, \E
escape

\t
horizontal tab

\b
backspace

Bindkey example

Translate push escape key to enter.

bindkey "\e" "some string e"

Overwrite backspace example

In my case bind backspace does not work bindkey "\b" well.

bindkey -L | grep backward-delete-char

bindkey "^H" backward-delete-char
bindkey "^?" backward-delete-char

I used ^?.

bindkey -s "^?" "some string b"

Ref

Versions

  • zsh 5.5.1 (x86_64-apple-darwin17.5.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment