Shell: Cleanup Zsh completion on custom pacman functions
parent
69999c95c0
commit
cdd45aa94a
|
@ -4,36 +4,30 @@
|
|||
|
||||
## Let's check if pacman completion is already loaded. If not, we parse the
|
||||
## pacman completion file.
|
||||
if [ -n "$(type _pacman_action_none | grep "not found")" ]; then
|
||||
if [ $(type _pacman_action_none | grep -c "not found") -gt 0 ]; then
|
||||
source "/usr/share/zsh/site-functions/_pacman"
|
||||
fi
|
||||
|
||||
_pcc () {
|
||||
case $words[1] in
|
||||
pacfiles)
|
||||
_pacman_action_query
|
||||
return ;;
|
||||
|
||||
pql)
|
||||
_pacman_action_query
|
||||
return ;;
|
||||
|
||||
pacsize)
|
||||
case $words[2] in
|
||||
-*q*)
|
||||
_pacman_action_query
|
||||
return ;;
|
||||
-)
|
||||
return 1;;
|
||||
-*)
|
||||
return 1 ;;
|
||||
*)
|
||||
_pacman_action_sync
|
||||
return ;;
|
||||
esac
|
||||
return ;;
|
||||
*)
|
||||
_pacman_action_sync
|
||||
return 1
|
||||
;;
|
||||
case $words[2] in
|
||||
-*)
|
||||
return 1 ;;
|
||||
*)
|
||||
_pacman_action_query
|
||||
return ;;
|
||||
esac
|
||||
return ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,10 @@ if [ "zsh" = "$SHELL_CURRENT" ]; then
|
|||
compdef _gs pdfcompress
|
||||
compdef _gs pdfextract
|
||||
compdef _gs pdfresize
|
||||
compdef _pacman pacman-color
|
||||
compdef _pcc pacfiles
|
||||
compdef _pcc pacsize
|
||||
compdef _pcc pql
|
||||
compdef _tex ltx
|
||||
compdef _path_commands typex
|
||||
compdef _pspdf zat
|
||||
compdef _pcc abs-wrapper
|
||||
fi
|
||||
|
|
|
@ -64,7 +64,6 @@ setopt pushdminus
|
|||
## Completion
|
||||
|
||||
## Custom completion
|
||||
## TODO: this is quite slow. Why?
|
||||
fpath=(~/.shell.d/completion $fpath)
|
||||
|
||||
autoload -Uz compinit
|
||||
|
|
Loading…
Reference in New Issue