From 6ded061a99e40bcb50cc9f905b330483a53f52e9 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Thu, 26 Sep 2024 15:55:42 -0400 Subject: [PATCH] zsh: Add completion for git-fetch-branch --- zsh/.zshrc | 2 ++ zsh/completions/_git-fetch-branch | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 zsh/completions/_git-fetch-branch diff --git a/zsh/.zshrc b/zsh/.zshrc index fbd287f..ce1e9ad 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -17,6 +17,8 @@ zstyle ':completion:*' _expand completer _complete _ignored zstyle ':completion:*' matcher-list '' 'l:|=* r:|=*' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=** r:|=**' zstyle :compinstall filename "$HOME/.zshrc" +fpath=("$HOME/.config/zsh/completions" $fpath) + autoload -Uz compinit compinit diff --git a/zsh/completions/_git-fetch-branch b/zsh/completions/_git-fetch-branch new file mode 100644 index 0000000..553094d --- /dev/null +++ b/zsh/completions/_git-fetch-branch @@ -0,0 +1,8 @@ +#compdef git-fetch-branch +#description fetch a branch by name + +_git-fetch-branch() { + __git_branch_names "$@" +} + +_git-fetch-branch "$@"