diff options
Diffstat (limited to 'dot_local/share/zsh/git/git.plugin.zsh')
-rw-r--r-- | dot_local/share/zsh/git/git.plugin.zsh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/dot_local/share/zsh/git/git.plugin.zsh b/dot_local/share/zsh/git/git.plugin.zsh new file mode 100644 index 0000000..8c7b362 --- /dev/null +++ b/dot_local/share/zsh/git/git.plugin.zsh @@ -0,0 +1,16 @@ +alias g='git' + +__git_aliases() { + local IFS=$'\n' + for _git_config_line in $(git config --list | grep -E '^alias\.' | cut -d. -f2-); do + if ! which "g${_git_config_line%%=*}" &>/dev/null; then + if [[ ${_git_config_line} = *'=!'* ]]; then + alias "g${_git_config_line:s/=\!/=}" + else + alias "g${_git_config_line:s/=/=git }" + fi + fi + done +} +__git_aliases +unset __git_aliases |