Last active
October 8, 2019 19:04
-
-
Save dedeibel/78e368c8c98fad9e895f3eaac2470ce5 to your computer and use it in GitHub Desktop.
git or svn status via keybindung in zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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