0848acfb25b6601adcabc406089b6c7788df5749

Author
Loïc Yhuel <loic.yhuel@gmail.com>
Committer
Loïc Yhuel <loic.yhuel@gmail.com>
Date

Message

Display red dots during completion process (disabled by default)

Diff

 1diff --git a/lib/completion.zsh b/lib/completion.zsh
 2index fdd0a8536cd4825235d0f4fddd217f0f398ea86b..b3cc918229ce3cdf60f6434cda1ecf1e7a385a77 100644
 3--- a/lib/completion.zsh
 4+++ b/lib/completion.zsh
 5@@ -59,3 +59,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
 6 # ... unless we really want to.
 7 zstyle '*' single-ignored show
 8 
 9+if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
10+  expand-or-complete-with-dots() {
11+    echo -n "\e[31m......\e[0m"
12+    zle expand-or-complete
13+    zle redisplay
14+  }
15+  zle -N expand-or-complete-with-dots
16+  bindkey "^I" expand-or-complete-with-dots
17+fi
18diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
19index 77f866d52c532ae5d217aa1c88e8f46d07a30c77..1ab40aba6d39eca4648267dfc25420b355c10b5b 100644
20--- a/templates/zshrc.zsh-template
21+++ b/templates/zshrc.zsh-template
22@@ -19,6 +19,9 @@ ZSH_THEME="robbyrussell"
23 # Uncomment following line if you want to disable autosetting terminal title.
24 # DISABLE_AUTO_TITLE="true"
25 
26+# Uncomment following line if you want red dots to be displayed while waiting for completion
27+# COMPLETION_WAITING_DOTS="true"
28+
29 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
30 # Example format: plugins=(rails git textmate ruby lighthouse)
31 plugins=(git)