6lmdla
Last Updated: February 25, 2016
·
690
· sheerun
Photo on 08.01.2013 at 04.15

Suspend and resume tool with single shortcut

By adding following code to your ~/.zshrc, you can suspend and resume any tool (vim for example) by pressing Ctrl-Z.

fancy-ctrl-z () {
  if [[ $#BUFFER -eq 0 ]]; then
    fg
    zle redisplay
  else
    zle push-input
  fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
Say Thanks
Respond
Filed Under