mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
feat: auto enable completion for zsh
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
This commit is contained in:
parent
63fd2ba998
commit
17f8815635
|
|
@ -1,10 +1,5 @@
|
|||
#!/bin/zsh
|
||||
#
|
||||
# forgit completions for zsh plugin
|
||||
#
|
||||
# When using forgit via the shell plugin, place completions/_git-forgit in your
|
||||
# $fpath (e.g. /usr/share/zsh/site-functions) and source this file after
|
||||
# forgit.plugin.zsh to enable tab completion for shell functions and aliases.
|
||||
|
||||
# Check if forgit plugin is loaded
|
||||
if (( $+functions[forgit::add] )); then
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ if [[ -n "$ZSH_VERSION" ]]; then
|
|||
# shellcheck disable=2277,2296,2298
|
||||
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||
INSTALL_DIR="${0:h}"
|
||||
fpath=("$INSTALL_DIR/completions" $fpath)
|
||||
elif [[ -n "$BASH_VERSION" ]]; then
|
||||
INSTALL_DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
else
|
||||
|
|
@ -175,3 +176,7 @@ if [[ -z "$FORGIT_NO_ALIASES" ]]; then
|
|||
alias "${forgit_blame}"='forgit::blame'
|
||||
|
||||
fi
|
||||
|
||||
if [[ -n "$ZSH_VERSION" ]]; then
|
||||
source "$INSTALL_DIR/completions/git-forgit.zsh"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue