config/.zsh/02_Completion.zsh

64 lines
2.2 KiB
Bash
Raw Normal View History

2010-11-25 16:23:40 +01:00
#Init completion System
2012-08-29 13:31:04 +02:00
zstyle :compinstall filename '$HOME/.zshrc'
2010-11-25 16:23:40 +01:00
autoload -Uz compinit
compinit
2014-08-02 01:08:24 +02:00
## case-insensitive (all),partial-word and then substring completion
if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unset CASE_SENSITIVE
else
2021-10-04 15:38:22 +02:00
#zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# small letter match capital but not the opposite
# e.g. "a" match android.test and Android.mk but
# "A" match Android.mk only
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
2014-08-02 01:08:24 +02:00
fi
# Color in completion
zstyle ':completion:*' list-colors ''
2010-11-25 16:23:40 +01:00
# Crée un cache des complétion possibles
# très utile pour les complétion qui demandent beaucoup de temps
# comme la recherche d'un paquet aptitude install moz<tab>
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh_cache
# Competion Verbose
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*' group-name ''
# Add autocompletion for sudo when command is not in $PATH
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin \
/usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin
# des couleurs pour la complétion
# faites un kill -9 <tab><tab> pour voir :)
zmodload zsh/complist
setopt extendedglob
zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
2014-08-02 01:08:24 +02:00
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
2010-11-25 16:23:40 +01:00
#completion des hosts avec le contenue de know_hosts
#local _myhosts
#if [[ -f $HOME/.ssh/known_hosts ]]; then
# _myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
# zstyle ':completion:*' hosts $_myhosts
#fi
#menu pour la completion
zstyle ':completion:*' menu select=2
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
2015-04-25 01:43:20 +02:00
#function completion
fpath=(~/.zsh/Completion ~/.zsh/functions $fpath)
autoload -U ~/.zsh/Completion/*(:t)
#Completion need `rehash` cmd to find newly installed soft or that
setopt nohashdirs