Skip to content

Instantly share code, notes, and snippets.

@dedeibel
Last active October 8, 2019 19:04
Show Gist options
  • Save dedeibel/78e368c8c98fad9e895f3eaac2470ce5 to your computer and use it in GitHub Desktop.
Save dedeibel/78e368c8c98fad9e895f3eaac2470ce5 to your computer and use it in GitHub Desktop.
git or svn status via keybindung in zsh
# .zsh/function/vcs_status
#
# Modify .zshrc:
#
# fpath=(~/.zsh/function $fpath)
#
# autoload vcs_status
# zle -N vcs_status
# bindkey '\es' vcs_status
#
function vcs_status {
# zle -U does not work since it is only executed after the widget
if (svn info 2> /dev/null > /dev/null); then
BUFFER="svn status"
else
BUFFER="git status"
fi
zle accept-line
true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment