Mercurial > dotfiles.old
diff zshrc @ 86:3a37086414bd
Improve tab completion
author | zegervdv <zegervdv@me.com> |
---|---|
date | Sat, 02 Aug 2014 10:56:31 +0200 |
parents | dd76ef1174f1 |
children | afe2d02577c2 |
line wrap: on
line diff
--- a/zshrc Thu Jul 31 21:38:35 2014 +0200 +++ b/zshrc Sat Aug 02 10:56:31 2014 +0200 @@ -39,6 +39,68 @@ # source $ZSH/plugins/history-substring-search/history-substring-search.zsh +setopt nobeep +setopt notify +REPORTTIME=5 +# GRML style completion +# activate color-completion +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} + +# format on completion +zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' + +# automatically complete 'cd -<tab>' and 'cd -<ctrl-d>' with menu +# zstyle ':completion:*:*:cd:*:directory-stack' menu yes select + +# insert all expansions for expand completer +zstyle ':completion:*:expand:*' tag-order all-expansions +zstyle ':completion:*:history-words' list false + +# activate menu +zstyle ':completion:*:history-words' menu yes + +# ignore duplicate entries +zstyle ':completion:*:history-words' remove-all-dups yes +zstyle ':completion:*:history-words' stop yes + +# match uppercase from lowercase +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' + +zstyle ':completion:*:matches' group 'yes' +zstyle ':completion:*' group-name '' +if [[ "$NOMENU" -eq 0 ]] ; 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 + +zstyle ':completion:*:messages' format '%d' +zstyle ':completion:*:options' auto-description '%d' + +# describe options in full +zstyle ':completion:*:options' description 'yes' +# Provide more processes in completion of programs like killall: +zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq' + +# complete manual by their section +zstyle ':completion:*:manuals' separate-sections true +zstyle ':completion:*:manuals.*' insert-sections true +zstyle ':completion:*:man:*' menu yes select + +# Search path for sudo completion +zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \ + /usr/local/bin \ + /usr/sbin \ + /usr/bin \ + /sbin \ + /bin \ + /usr/X11R6/bin + +# provide .. as a completion +zstyle ':completion:*' special-dirs .. + # Customize to your needs... export PATH=$PATH:/usr/local/opt/ruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin:/usr/local/sbin export PATH="/usr/local/bin:$PATH"