completion (1021B)
1 #!/bin/zsh 2 3 # https://github.com/zsh-users/zsh-completions 4 if [[ -d $HOME/.config/zsh/plugins/zsh-completions/src ]]; then 5 fpath=($HOME/.config/zsh/plugins/zsh-completions/src $fpath) 6 fi 7 8 autoload -U compinit 9 10 # Checking the cached .zcompdump file to see if it must be regenerated adds a 11 # noticable delay to zsh startup. This little hack restricts it to once a day. 12 if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then 13 compinit; 14 else 15 compinit -C; 16 fi; 17 18 LISTMAX=0 19 20 # zsh's git tab completion by default is extremely slow. This makes it use 21 # local files only. See http://stackoverflow.com/a/9810485/945780. 22 __git_files () { 23 _wanted files expl 'local files' _files 24 } 25 26 # Fuzzy matching 27 # 0 -- vanilla completion (abc => abc) 28 # 1 -- smart case completion (abc => Abc) 29 # 2 -- word flex completion (abc => A-big-Car) 30 # 3 -- full flex completion (abc => ABraCadabra) 31 zstyle ':completion:*' matcher-list '' \ 32 'm:{a-z\-}={A-Z\_}' \ 33 'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \ 34 'r:|?=** m:{a-z\-}={A-Z\_}'