From 33de9280e0c6a12546cc1b1b6f30a075738f0b26 Mon Sep 17 00:00:00 2001 From: mlunax Date: Tue, 3 Nov 2020 20:53:30 +0100 Subject: [PATCH] ctrl-z switch --- .zshrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.zshrc b/.zshrc index 3214a83..6f2c3ad 100644 --- a/.zshrc +++ b/.zshrc @@ -18,6 +18,17 @@ for f in $OTHER/*.zsh; do fi done +# Turn control+z into a toggle switch +ctrlz() { + if [[ $#BUFFER == 0 ]]; then + fg >/dev/null 2>&1 && zle redisplay + else + zle push-input + fi +} +zle -N ctrlz +bindkey '^Z' ctrlz + if [ -d "$HOME/.zsh-custom" ]; then for f in $HOME/.zsh-custom/*; do if [ -f $f ]; then