diff --git a/modules/completion/compdefs.zsh b/modules/completion/compdefs.zsh new file mode 100644 index 0000000..465f8e3 --- /dev/null +++ b/modules/completion/compdefs.zsh @@ -0,0 +1,14 @@ +# +# Alias compdefs +# + +# Any aliased commands will not function with completion without compdefs. +# Because completion is the LAST module to be loaded (so we make sure to catch all completions) +# we must assign the compdefs here, as opposed to within the modules themselves. + +# Unfortunately, I'm not aware of a worthwhile way to ensure that these will be included in .zcompdump + +# zpacman_frontend -> pacman +if (( ${+zpacman_frontend} )); then + compdef ${zpacman_frontend}='pacman' +fi diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index fc5e420..5197a18 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -17,6 +17,10 @@ fpath=(${0:h}/external/src ${fpath}) # load and initialize the completion system autoload -Uz compinit && compinit -C -d ${ZDOTDIR:-$HOME}/.zcompdump + +# set any compdefs +source ${0:h}/compdefs.zsh + { # zcomple the .zcompdump in the background local zcompdump=${ZDOTDIR:-$HOME}/.zcompdump diff --git a/modules/pacman/alias.zsh b/modules/pacman/alias.zsh index 957d695..0c67b35 100644 --- a/modules/pacman/alias.zsh +++ b/modules/pacman/alias.zsh @@ -9,7 +9,6 @@ # General # -alias pacman=${zpacman_frontend} alias pac=${zpacman_frontend} #