From 69a37997cb70db28523a3463a0579d2e6f1f9575 Mon Sep 17 00:00:00 2001 From: Erin Date: Wed, 2 Nov 2022 11:22:15 -0400 Subject: [PATCH] zsh: add keybind ^Z for quick `fg` --- zsh/.config/zsh/config.d/10_keybinds.zsh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 zsh/.config/zsh/config.d/10_keybinds.zsh diff --git a/zsh/.config/zsh/config.d/10_keybinds.zsh b/zsh/.config/zsh/config.d/10_keybinds.zsh new file mode 100644 index 0000000..3adf51a --- /dev/null +++ b/zsh/.config/zsh/config.d/10_keybinds.zsh @@ -0,0 +1,12 @@ +# Bind ^Z on an empty line to resume the last suspended job +fancy-ctrl-z () { + if [[ $#BUFFER -eq 0 ]]; then + BUFFER="fg" + zle accept-line + else + zle push-input + zle clear-screen + fi +} +zle -N fancy-ctrl-z +bindkey '^Z' fancy-ctrl-z