Refactors short host retrieval.

This commit is contained in:
LFDM 2014-01-04 23:39:16 +01:00
commit 9a7069dbcb

View file

@ -31,16 +31,12 @@ find_plugin_paths() {
} }
initialize_completions() { initialize_completions() {
# Figure out the SHORT hostname # Figure out the SHORT hostname, scutil is for OS X users
if [ -n "$commands[scutil]" ]; then local short_host
# OS X short_host=$($(scutil --get ComputerName 2>/dev/null) || echo ${HOST/.*/})
SHORT_HOST=$(scutil --get ComputerName)
else
SHORT_HOST=${HOST/.*/}
fi
# Save the location of the current completion dump file. # Save the location of the current completion dump file.
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${short_host}-${ZSH_VERSION}"
# plugins need to be added to the functions path before compinit # plugins need to be added to the functions path before compinit
fpath=($ZSH_PLUGIN_PATHS $fpath) fpath=($ZSH_PLUGIN_PATHS $fpath)