Added git completion to zsh
parent
db2c1a6ee2
commit
70d93acb15
|
@ -0,0 +1,16 @@
|
|||
_fzf_complete_git() {
|
||||
ARGS="$@"
|
||||
local branches
|
||||
branches=$(git branch --all --sort=-committerdate --format="%(refname:short)")
|
||||
if [[ $ARGS == 'git co'* || $ARGS == 'git checkout'* || $ARGS == 'git merge'* ]]; then
|
||||
_fzf_complete -- "$@" < <(
|
||||
echo $branches
|
||||
)
|
||||
else
|
||||
eval "zle ${fzf_default_compeltion:-expand-or-complete}"
|
||||
fi
|
||||
}
|
||||
|
||||
_fzf_complete_git_post() {
|
||||
sed "s/^origin\///"
|
||||
}
|
Loading…
Reference in New Issue