475fb3a29bb551abfa7a55fdf1ad4905da39928a

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1829 from docwhat/compinit

Create the zcompdump based on version and host

Diff

 1diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 2index 93c10e3d2e92ee111258a45d58aed8848ca13991..15c1dce44c19249a12823c5493226edc61358ce0 100644
 3--- a/oh-my-zsh.sh
 4+++ b/oh-my-zsh.sh
 5@@ -38,10 +38,20 @@ for plugin ($plugins); do
 6   fi
 7 done
 8 
 9+# Figure out the SHORT hostname
10+if [ -n "$commands[scutil]" ]; then
11+  # OS X
12+  SHORT_HOST=$(scutil --get ComputerName)
13+else
14+  SHORT_HOST=${HOST/.*/}
15+fi
16+
17+# Save the location of the current completion dump file.
18+ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
19+
20 # Load and run compinit
21 autoload -U compinit
22-compinit -i
23-
24+compinit -i -d "${ZSH_COMPDUMP}"
25 
26 # Load all of the plugins that were defined in ~/.zshrc
27 for plugin ($plugins); do