config/zsh: update completions

This commit is contained in:
xerus2000 2021-04-19 10:38:28 +02:00
parent 444a57acb3
commit 07e7109fa9
11 changed files with 15 additions and 24 deletions

View File

@ -1 +0,0 @@
.zcompdump

View File

@ -47,13 +47,15 @@ plugins=(
)
_comp_options+=(globdots) # Show files starting with dot in autocomplete
fpath=($fpath "$CONFIG_ZSH/zsh_completion") # Custom completions
fpath=($fpath "$CONFIG_ZSH/completion") # Custom completions
ZSH_COMPDUMP="$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION" # Cache completions
DISABLE_UPDATE_PROMPT=true
ZSH_DISABLE_COMPFIX=true
source $ZSH/oh-my-zsh.sh
compdef wh=which
## Functions
tab_list_files() {

View File

@ -0,0 +1,2 @@
#compdef edbin
compadd $(echo $PATH | cut -d':' -f1 | xargs ls -pA)

View File

@ -0,0 +1,2 @@
#compdef edshell
compadd -V unsorted zsh profile $(ls -pA $CONFIG_SHELLS)

View File

@ -0,0 +1,2 @@
#compdef git_rmbranch git_rebranch
compadd $(git branch --format='%(refname:short)' | grep -v master | grep -v main)

View File

@ -0,0 +1,6 @@
#compdef gitclone gitremote
_arguments '-hub[GitHub]:hub:->github.com' '-lab[Gitlab]:GitLab:->gitlab.com'
case "$state" in
(github.com|'""') compadd $(curl -s https://api.github.com/users/xerus2000/repos?per_page=100 | grep '"name"' | grep -v ' ' | cut -d'"' -f4);;
(gitlab.com) _values -s , 'flags' a b c d e;;
esac

View File

@ -1,2 +0,0 @@
#compdef editshell
compadd $(ls -pA $SHELL_CONFIG | grep -v / )

View File

@ -1,18 +0,0 @@
#compdef gitclone
_arguments '-hub[GitHub]:hub:->hub' '-lab[Gitlab]:GitLab:->lab'
case "$state" in
hub) compadd $(curl -s https://api.github.com/users/xerus2000/repos?per_page=100 | grep '"name"' | grep -v ' ' | cut -d'"' -f4);;
lab) _values -s , 'flags' a b c d e;;
esac
cur=$words[$CURRENT-1]
unset 'words[-1]'
case $cur in
-p) compadd {13060..13069};;
*)
case $PREFIX in
-*) compadd -- -p -g -min -v -vv -nodocker;;
*) compadd $(find $projects_dir/softwarechallenge2018/clients -name "*.jar" | sed "s|.*Jumper-||" | sed "s|.jar||" | while read in; do for word in $words; do [ "$in" = "$word" ] && continue 2; done; echo $in; done)
compadd -- -p -g -min -v -vv -nodocker;;
esac
esac

View File

@ -1,2 +0,0 @@
#compdef gitrmbranch gitrebranch
compadd $(git branch | cut -c 3- | grep -v master)