auto-bg/fg with C-z

This commit is contained in:
Henrik Lissner 2015-12-12 16:59:07 -05:00
parent 3b118afb92
commit 047c71f8b5

View file

@ -55,6 +55,19 @@ bindkey -M vicmd 'Y' vi-yank-eol
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# C-z to background *and* foreground processes
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
# Completion
bindkey -M viins '^x^f' fasd-complete-f # C-x C-f to do fasd-complete-f (only files)
bindkey -M viins '^x^d' fasd-complete-d # C-x C-d to do fasd-complete-d (only directories)