if /bin/true && [[ "$ZSH_VERSION_TYPE" == 'new' ]]; then autoload -U compinit compinit -u else #print "\nAdvanced completion system not found; ignoring zstyle settings." which zstyle >/dev/null || function zstyle { } which compdef >/dev/null || function compdef { } fi ## compstyle is obsoleted now #which compstyle >/dev/null || alias compstyle=zstyle # General completion technique zstyle ':completion:*' completer _expand_dots _complete _match _correct _7slash # oder auch: _approximate _history # first try _match without appending a * zstyle ':completion::match:*' original yes zstyle ':completion::match:*' insert-unambiguous true # options for approximate zstyle ':completion::approximate:*' max-errors 2 numeric zstyle ':completion::approximate:*' insert-unambiguous true # don't complete the directory in which we are zstyle ':completion:*' ignore-parents parent pwd # don't complete the same filenames again zstyle ':completion:*:(rm|cp|mv):*' ignore-line other zstyle ':incremental' completer _complete _correct _7slash zstyle ':predict' completer _complete # Filename suffixes to ignore during completion #fignore=(.o \~) # better solution: # filename suffixes to ignore during completion (except after rm command) zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns \ '*?.(o|c~)' '*?~' # if there are other completions, always show them unsetopt rec_exact # we want . and .. to be completed, too #zstyle ':completion:*:paths' special-dirs yes zstyle ':completion:*:(cd|chdir|pushd|popd):*' special-dirs .. # I want this for _all_ commands zstyle ':completion:*:*:*' special-dirs .. # complete case insensitive #zstyle ":completion:*" matcher-list 'm:{A-ZÖÄÜa-zöäü}={a-zöäüA-ZÖÄÜ}' zstyle ":completion:*" matcher-list 'm:{A-Zöäüa-zÖÄÜ}={a-zÖÄÜA-Zöäü}' #zstyle ':completion:*' matcher-list '' 'r:|[._-]=* r:|=*' 'm:{a-zA-Z}={A-Za-z}' zstyle ':completion:*' squeeze-slashes true # menu selection if more than 5 files are to be completed # use 'long' to start menu compl. if list is bigger than screen #zstyle ':completion:*' menu yes=2 select=5 interactive zstyle ':completion:*' menu select=5 interactive # show the default prompt while scrolling during menu selection MENUPROMPT= setopt LIST_ROWS_FIRST LIST_PACKED ## completion caching #zstyle ':completion::complete:*' use-cache 1 #zstyle ':completion::complete:*' cache-path ~/.zcompcache/$HOST ## Cache functions created by _regex_arguments #zstyle '*' cache-path ~/.zsh/.cache-path zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache/$HOST # Expand partial paths # ASp: too slow! :-( #zstyle '*' expand 'yes' ## don't complete backup files as executables #zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~' # Separate matches into groups zstyle '*:matches' group 'yes' zstyle ':completion:*' group-name '' zstyle ':completion:*:*:-command-:*' group-order builtins functions aliases commands zstyle ':completion:*' group-order files directories # Describe each match group. # This one assumes that your terminal has a dark background. zstyle '*:descriptions' format "$fg_bold[yellow]%d$fg_no_bold[cyan]" # Describe options in full zstyle '*:options' description 'yes' zstyle '*:options' auto-description '%d' # don't show elements from cdpath when completing after cd #zstyle ':completion:*:cd:*' tag-order local-directories path-directories # emacs-like history-search (only search through the last 200 words) zstyle '*:history-words' stop 'verbose' zstyle '*:history-words' remove-all-dups 'yes' zstyle '*:history-words' range '200' # try slice by slice of each 500 words #zstyle '*:history-words' range '200:500' # Hosts, usernames, groups, ports hosts=( "${(@)${(@s: :)${(@s: :)${(@)${(@f)$(/dev/null))' fi #: ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)"$(