changeset 86:3a37086414bd

Improve tab completion
author zegervdv <zegervdv@me.com>
date Sat, 02 Aug 2014 10:56:31 +0200
parents 8a5464ec3c29
children aefa231684d9
files .hgsubstate zshrc
diffstat 2 files changed, 63 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Thu Jul 31 21:38:35 2014 +0200
+++ b/.hgsubstate	Sat Aug 02 10:56:31 2014 +0200
@@ -55,4 +55,4 @@
 2c03d82a0e4662adf1e347487d73a9bf4bf6fdac vim/bundle/vimwiki
 22fa4e57fa3b0e4c9a83de51717b621fe9ca8cd7 vim/bundle/vis
 a884f3a161fa3cd8c996eb53a3d1c68631f60c21 vim/bundle/yankring
-70054a373fe21d41aab17f65a3f40877c2747a2e vimwiki
+1dc48015a65282443bfc1c74279b0bbcc2ba3bf2 vimwiki
--- 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"