diff options
author | Alen <alen@dotfiles.xyz> | 2025-01-19 03:26:44 +0400 |
---|---|---|
committer | Alen <alen@dotfiles.xyz> | 2025-01-19 03:26:44 +0400 |
commit | 43c982798c902315aba2f8865d0407c6ff70a180 (patch) | |
tree | 469de00c188d60d2859066cfa94bf2880b16eb46 /dot_local/share/zsh/git | |
parent | 6e8b63f101e056f80cf6b7d17d07161bead1ceeb (diff) |
Add batch of zsh plugins and kitting out
Diffstat (limited to 'dot_local/share/zsh/git')
-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 |