mirror of https://github.com/bjeanes/dotfiles.git
Clean up ZSH completions and group matches intelligently
parent
8e341a0243
commit
8812f7e422
|
@ -0,0 +1,41 @@
|
||||||
|
#
|
||||||
|
# completion tweaking
|
||||||
|
#
|
||||||
|
autoload -U compinit; compinit
|
||||||
|
|
||||||
|
# Group matches and describe groups
|
||||||
|
zstyle ':completion:*:matches' group 'yes'
|
||||||
|
zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m'
|
||||||
|
zstyle ':completion::complete:cd:' tag-order local-directories path-directories
|
||||||
|
zstyle ':completion:*' group-name ''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# zstyle ':completion:*:options' description 'yes'
|
||||||
|
# zstyle ':completion:*:options' auto-description '%d'
|
||||||
|
# zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m'
|
||||||
|
# zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m'
|
||||||
|
|
||||||
|
# zstyle ':completion:*' verbose yes
|
||||||
|
# zstyle ':completion:*' use-cache on
|
||||||
|
# zstyle ':completion:*' users resolve
|
||||||
|
# hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
|
||||||
|
# zstyle ':completion:*:hosts' hosts $hosts
|
||||||
|
# zstyle ':completion::complete:cd:' tag-order local-directories path-directories
|
||||||
|
|
||||||
|
# # use dircolours in completion listings
|
||||||
|
# zstyle ':completion:*' list-colors ${(s.:.)LSCOLORS}
|
||||||
|
#
|
||||||
|
# # allow approximate matching
|
||||||
|
# zstyle ':completion:*' completer _complete _match _approximate
|
||||||
|
# zstyle ':completion:*:match:*' original only
|
||||||
|
# zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
||||||
|
# zstyle ':completion:*' auto-description 'Specify: %d'
|
||||||
|
# zstyle ':completion:*' verbose true
|
||||||
|
# zstyle ':completion:*:functions' ignored-patterns '_*'
|
||||||
|
# zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns \
|
||||||
|
# '*?.(o|c~|zwc)' '*?~'
|
24
zsh/config
24
zsh/config
|
@ -29,27 +29,3 @@ setopt recexact # recognise exact, ambiguous matches
|
||||||
# for kill-word, etc.
|
# for kill-word, etc.
|
||||||
export WORDCHARS=''
|
export WORDCHARS=''
|
||||||
|
|
||||||
#
|
|
||||||
# completion tweaking
|
|
||||||
#
|
|
||||||
|
|
||||||
# complete hostnames out of ssh's ~/.ssh/known_hosts
|
|
||||||
autoload -U compinit; compinit
|
|
||||||
zstyle ':completion:*' use-cache on
|
|
||||||
zstyle ':completion:*' users resolve
|
|
||||||
hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
|
|
||||||
zstyle ':completion:*:hosts' hosts $hosts
|
|
||||||
|
|
||||||
# use dircolours in completion listings
|
|
||||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
|
||||||
|
|
||||||
# allow approximate matching
|
|
||||||
zstyle ':completion:*' completer _complete _match _approximate
|
|
||||||
zstyle ':completion:*:match:*' original only
|
|
||||||
zstyle ':completion:*:approximate:*' max-errors 1 numeric
|
|
||||||
zstyle ':completion:*' auto-description 'Specify: %d'
|
|
||||||
zstyle ':completion:*' format 'Completing %d'
|
|
||||||
zstyle ':completion:*' verbose true
|
|
||||||
zstyle ':completion:*:functions' ignored-patterns '_*'
|
|
||||||
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns \
|
|
||||||
'*?.(o|c~|zwc)' '*?~'
|
|
||||||
|
|
|
@ -10,6 +10,9 @@ source $DOT_FILES/zsh/oh-my-zsh
|
||||||
# Extra ZSH configuration
|
# Extra ZSH configuration
|
||||||
source $DOT_FILES/zsh/config
|
source $DOT_FILES/zsh/config
|
||||||
|
|
||||||
|
# Rake completion
|
||||||
|
source $DOT_FILES/zsh/completions
|
||||||
|
|
||||||
# My custom theme
|
# My custom theme
|
||||||
source $DOT_FILES/zsh/theme
|
source $DOT_FILES/zsh/theme
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue