Easy foreground switch with zsh

7c8ced9f2f96f9ab612ac3d64b48a9d0e718215d
Alexis Sellier committed ago 1 parent d4f2a030
.zshrc +13 -0
125 125
126 126
col() {
127 127
  awk "{ print \$$1 }"
128 128
}
129 129
130 +
#
131 +
# Switch to `fg` process with Ctrl-Z
132 +
#
133 +
fg-command() {
134 +
  if [[ ! $#BUFFER -eq 0 ]]; then
135 +
    zle push-input
136 +
  fi
137 +
  BUFFER="fg"
138 +
  zle accept-line
139 +
}
140 +
zle -N fg-command
141 +
bindkey '^Z' fg-command
142 +
130 143
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh