Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
90 lines (75 sloc) 5.03 KB
# Files to ignore during completion
fignore=(DS_Store $fignore)
autoload -Uz compinit
compinit -C
autoload -U zsh-mime-setup
autoload -U zsh-mime-handler
zsh-mime-setup
zmodload zsh/complist
zstyle ':completion:*' use-cache on # If this is set, the completion caching layer is activated for any completions which use it
zstyle ':completion:*' use-perl on # Various parts of the function system use awk to extract words from files or command output as this universally available. However, many versions of awk have arbitrary limits on the size of input. If this style is set, perl will be used instead.
zstyle ':completion:*' use-ip on # By default, the function _hosts that completes host names strips IP addresses from entries read from host databases such as NIS and ssh files. If this style is true, the corresponding IP addresses can be completed as well.
zstyle ':completion:*' list-grouped true # If this style is ‘true’ (the default), the completion system will try to make certain completion listings more compact by grouping matches.
zstyle ':completion:*' list-packed true # This is tested for each tag valid in the current context as well as the default tag. If it is set to ‘true’, the corresponding matches appear in listings as if the LIST_PACKED option were set.
zstyle ':completion:*' verbose true # If set, as it is by default, the completion listing is more verbose. In particular many commands show descriptions for options if this style is ‘true’.
zstyle ':completion:*' completer _complete _prefix _match _approximate _ignored # The strings given as the value of this style provide the names of the completer functions to use.
# _expand
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' ignore-parents parent pwd
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-separator '#'
zstyle ':completion:*' auto-description 'specify: %d'
# Enable menu completion
#zstyle ':completion*:default' menu 'select=1' # In the form ‘select=num’, menu selection will only be started if there are at least num matches
if [[ -z "$NOMENU" ]] ; then
# if there are more than 5 options allow selecting from a menu
zstyle ':completion:*' menu select=5
else
# don't use any menus at all
setopt NO_AUTO_MENU
fi
# allow approximate matching
#zstyle ':completion:*:corrections' format '%U%B%d (errors: %e)%b%u'
#zstyle ':completion:*:match:*' original only
#zstyle ':completion:*:approximate:*' max-errors 2 numeric # This is used by the _approximate and _correct completer functions to determine the maximum number of errors to allow. The completer will try to generate completions by first allowing one error, then two errors, and so on, until either a match or matches were found or the maximum number of errors given by this style has been reached.
#zstyle ':completion::approximate*:*' prefix-needed false
#zstyle ':completion:*:(^approximate):*' matcher-list 'm:{a-z}={A-Z}'
#zstyle ':completion::complete:*:functions' ignored-patterns '_*'
#zstyle ':completion::complete:chown:*' ignored-patterns '_*'
#zstyle ':completion:*:prefix:*' add-space true
#zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.(o|c~|zwc)' '*?~'
# only java files for javac
zstyle ':completion:*:javac:*' files '*.java'
# no binary files for vi or textmate
zstyle ':completion:*:vi:*' ignored-patterns '*.(o|a|so|aux|dvi|log|swp|fig|bbl|blg|bst|idx|ind|out|toc|class|pdf|ps|pyc)'
zstyle ':completion:*:vim:*' ignored-patterns '*.(o|a|so|aux|dvi|log|swp|fig|bbl|blg|bst|idx|ind|out|toc|class|pdf|ps|pyc)'
zstyle ':completion:*:mvim:*' ignored-patterns '*.(o|a|so|aux|dvi|log|swp|fig|bbl|blg|bst|idx|ind|out|toc|class|pdf|ps|pyc)'
# no binary files for less
zstyle ':completion:*:less:*' ignored-patterns '*.(o|a|so|dvi|fig|out|class|pdf|ps|pyc)'
zstyle ':completion:*:zless:*' ignored-patterns '*.(o|a|so|dvi|fig|out|class|pdf|ps|pyc)'
# pdf for xpdf
zstyle ':completion:*:xpdf:*' files '*.pdf'
# tar files
zstyle ':completion:*:tar:*' files '*.tar|*.tgz|*.tz|*.tar.Z|*.tar.bz2|*.tZ|*.tar.gz'
# latex to the fullest
# for printing
#zstyle ':completion:*:xdvi:*' files '*.dvi'
#zstyle ':completion:*:dvips:*' files '*.dvi'
# Group relatex matches:
zstyle ':completion:*:-command-:*:(commands|builtins|reserved-words-aliases)' group-name commands
# Separate man page sections
zstyle ':completion:*:manuals' seperate-sections true
# Give long completion options in a list. tab to advance.
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for:%{\e[0m%} %d'
#'%BNo matches for: %d%b'
zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
zstyle ':completion:*:windows' menu on=0
# Ignore completion functions for commands you don't have:
zstyle ':completion:correct:' prompt 'correct to: %e'
zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*'
# caching
[ -d $ZSHDIR/cache ] \
&& zstyle ':completion:*' use-cache yes \
&& zstyle ':completion::complete:*' cache-path $ZSHDIR/cache/