]> git.siccegge.de Git - dotfiles/zsh.git/commitdiff
Add _force_rehash completer from Simon
authorChristoph Egger <christoph@christoph-egger.org>
Sat, 1 Aug 2015 17:00:48 +0000 (19:00 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Sat, 1 Aug 2015 17:00:48 +0000 (19:00 +0200)
zshrc

diff --git a/zshrc b/zshrc
index abd47ce5a61cbf00d758a90a76009d23573bc82b..64ad4eaceb21954fb67ff78829269572a6b7812f 100644 (file)
--- a/zshrc
+++ b/zshrc
@@ -34,10 +34,19 @@ colors
 
 zmodload -i zsh/complist
 
+_force_rehash() {
+    if (( CURRENT == 1 )); then
+        rehash
+    fi
+    # We didn't really complete anything.
+    return 1
+}
+
 zstyle :compinstall filename '/home/christoph/.zshrc'
 zstyle ':completion:*' menu select=3
 zstyle -e ':completion::*:*:*:hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2|_uni|_debian)(N) /dev/null)"}%%[# ]*}//,/ })'
 zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
+zstyle ':completion:::::' completer _force_rehash _complete _approximate _expand _ignored
 
 bindkey -e
 bindkey '\ee' backward-word