Skip to content

Commit

Permalink
Create the zcompdump based on version and host
Browse files Browse the repository at this point in the history
This will prevent lots of subtle problems that happen when
people upgrade ZSH or use NFS mounted home directories.

The ZSH_COMPDUMP variable can also be used to implement `zcompile`
and other fun features in the future.
  • Loading branch information
Christian Ho虉ltje committed May 17, 2013
1 parent 27c6bec commit d2fe03d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions oh-my-zsh.sh
Expand Up @@ -38,10 +38,20 @@ for plugin ($plugins); do
fi
done

# Figure out the SHORT hostname
if [ -n "$commands[scutil]" ]; then
# OS X
SHORT_HOST=$(scutil --get ComputerName)

This comment has been minimized.

Copy link
@ryh

ryh Nov 10, 2013

what's this for? caused #2155

else
SHORT_HOST=${HOST/.*/}
fi

# Save the location of the current completion dump file.
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"

# Load and run compinit
autoload -U compinit
compinit -i

compinit -i -d "${ZSH_COMPDUMP}"

# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
Expand Down

0 comments on commit d2fe03d

Please sign in to comment.