Skip to content

Instantly share code, notes, and snippets.

@georgebashi
Created November 17, 2014 19:20
Show Gist options
  • Save georgebashi/ceedfd2a7bba417510f5 to your computer and use it in GitHub Desktop.
Save georgebashi/ceedfd2a7bba417510f5 to your computer and use it in GitHub Desktop.
function fg-or-run-vim () {
if [[ $#jobstates -eq 0 ]]; then
BUFFER='vim'
zle accept-line
else
BUFFER='fg'
zle accept-line
fi
}
zle -N fg-or-run-vim
bindkey '^Z' fg-or-run-vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment