diff --git a/tag-zsh/aliases b/tag-zsh/aliases index d626e56..66ae412 100644 --- a/tag-zsh/aliases +++ b/tag-zsh/aliases @@ -5,10 +5,15 @@ alias ln='ln -v' alias mkdir='mkdir -p' # alias tig='tig --all' -# # Git -# alias gad='git add' -# alias gcm='git commit -m' -# alias gsw='git switch' +# Git +alias gad=fz-git-add +alias gbr=fz-git-branch +alias gco=fz-git-checkout +alias gsh=fz-git-show +alias gdel=fz-git-delte-branch +alias gsta=fz-git-stash-apply +alias gcm='git commit -m' +alias gsw='git switch' # Pretty print the path alias path='echo $PATH | tr -s ":" "\n"' diff --git a/tag-zsh/zsh/configs/fzf.zsh b/tag-zsh/zsh/configs/fzf.zsh index 70dfd21..19150c9 100644 --- a/tag-zsh/zsh/configs/fzf.zsh +++ b/tag-zsh/zsh/configs/fzf.zsh @@ -26,7 +26,7 @@ _gitLogLineToHash="echo {} | grep -o '[a-f0-9]\{7\}' | head -1" _viewGitLogLine="$_gitLogLineToHash | xargs -I % sh -c 'git show --color=always % | diff-so-fancy'" # git commit browser with previews -gshow() { +fz-git-show() { glNoGraph | fzf --no-sort --reverse --tiebreak=index --no-multi \ --ansi --preview="$_viewGitLogLine" \ @@ -36,7 +36,7 @@ gshow() { } # checkout git branch (including remote branches), sorted by most recent commit, limit 30 last branches -gbr() { +fz-git-branch() { local branches branch branches=$(git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format="%(refname:short)") && branch=$(echo "$branches" | @@ -47,7 +47,7 @@ gbr() { } # checkout git commit with previews -gco() { +fz-git-checkout() { local commit commit=$( glNoGraph | fzf --no-sort --reverse --tiebreak=index --no-multi \ @@ -58,7 +58,7 @@ gco() { } # delete git branches -gdel() { +fz-git-delete-branch() { local branches delete_branches branches=$(git --no-pager branch | grep -vE '(main|master|development)') delete_branches=$(echo "$branches" | fzf --multi) @@ -66,7 +66,7 @@ gdel() { } # git add with previews -gad() { +fz-git-add() { git ls-files --deleted --modified --other --exclude-standard | \ fzf \ --multi \ @@ -75,7 +75,7 @@ gad() { } # git stash apply with previews -gsta() { +fz-git-stash-apply() { git stash list | \ fzf \ --exit-0 \