zsh: add keybind ^Z for quick fg

This commit is contained in:
Erin 2022-11-02 11:22:15 -04:00
parent 62ab793ac0
commit 69a37997cb

View file

@ -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