Fix autocompletion for g function

Fixes #4
This commit is contained in:
Oliver Davies 2020-02-25 21:53:36 +00:00
parent 640e0f2a51
commit e4fa6d1a5b
3 changed files with 31 additions and 8 deletions

View file

@ -1,6 +1,18 @@
autoload -U compinit
compinit
# load our own completion functions
fpath=(
~/.zsh/completion
/usr/local/share/zsh/site-functions
$fpath
)
## case-insensitive (all), partial-word and then substring completion
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' \
'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# completion; use cache if updated within 24h
autoload -Uz compinit
if [[ -n $HOME/.zcompdump(#qN.mh+24) ]]; then
compinit -d $HOME/.zcompdump;
else
compinit -C;
fi;
# disable zsh bundled function mtools command mcd
# which causes a conflict.
compdef -d mcd

View file

@ -0,0 +1,14 @@
# load our own completion functions
fpath=(~/.zsh/completion /usr/local/share/zsh/site-functions $fpath)
# completion; use cache if updated within 24h
autoload -Uz compinit
if [[ -n $HOME/.zcompdump(#qN.mh+24) ]]; then
compinit -d $HOME/.zcompdump;
else
compinit -C;
fi;
# disable zsh bundled function mtools command mcd
# which causes a conflict.
compdef -d mcd

View file

@ -7,6 +7,3 @@ g() {
git status --short --branch
fi
}
# Complete g like git
compdef g=git