From 43c982798c902315aba2f8865d0407c6ff70a180 Mon Sep 17 00:00:00 2001 From: Alen Date: Sun, 19 Jan 2025 03:26:44 +0400 Subject: Add batch of zsh plugins and kitting out --- dot_local/share/zsh/git/git.plugin.zsh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 dot_local/share/zsh/git/git.plugin.zsh (limited to 'dot_local/share/zsh/git') 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 -- cgit 1.4.1-2-gfad0