aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/zsh/.zshrc15
1 files changed, 11 insertions, 4 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 4564568..15f7d29 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -298,10 +298,17 @@ getstate () {
}
# use ctrl-z to toggle in and out of bg
-if [[ $- == *i* ]]; then
- stty susp undef
- bind '"\C-z":" fg\015"'
-fi
+function toggle_fg_bg() {
+ if [[ $#BUFFER -eq 0 ]]; then
+ BUFFER="fg"
+ zle accept-line
+ else
+ BUFFER=""
+ zle clear-screen
+ fi
+}
+zle -N toggle_fg_bg
+bindkey '^Z' toggle_fg_bg
# cd using "up n" as a command up as many directories, example "up 3"
up() {