Reputation: 151
If I write a zsh function like this
function git_checkout_with_selecta() {
if [[ -z $1 ]]; then
git checkout `git branch --no-merged | selecta`
else
git checkout "$@"
fi
}
alias gco='git_checkout_with_selecta'
How can I apply the same tab completions that I have for 'git checkout' to the alias for the function 'gco'?
Upvotes: 15
Views: 858
Reputation: 27858
compdef _git gco=git-checkout
This will use the _git
completion function, and sets git-checkout
as the service/sub-command.
Upvotes: 7
Reputation: 1537
Something like:
compdef gco=git
If your completer triggers on git.
Upvotes: 2