summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2015-01-31 06:23:50 -0600
committerRobby Russell <robby@planetargon.com>2015-01-31 06:23:50 -0600
commit550ccca91cb45fcf26a8f2c3c60da675b995e3f3 (patch)
treebae0321bcee402b24fb9320a02e1991b1be26553
parent1ac2f8645e9cec48cbcb036f02479d3666ae13c8 (diff)
parentceb42ecdb6296b136e3ead9e6ab53c24a01fedc9 (diff)
downloadzsh-550ccca91cb45fcf26a8f2c3c60da675b995e3f3.tar.gz
zsh-550ccca91cb45fcf26a8f2c3c60da675b995e3f3.tar.bz2
zsh-550ccca91cb45fcf26a8f2c3c60da675b995e3f3.zip
Merge pull request #3478 from stephenrjohnson/custom_cache_dir
Allow custom cache dir
-rw-r--r--lib/completion.zsh2
-rw-r--r--oh-my-zsh.sh7
-rw-r--r--plugins/last-working-dir/last-working-dir.plugin.zsh4
-rw-r--r--plugins/zsh_reload/zsh_reload.plugin.zsh2
4 files changed, 11 insertions, 4 deletions
diff --git a/lib/completion.zsh b/lib/completion.zsh
index 3a19a4eba..ea6139fde 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -38,7 +38,7 @@ cdpath=(.)
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
-zstyle ':completion::complete:*' cache-path $ZSH/cache/
+zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
# Don't complete uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index d75b521c7..bc7a8e496 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -14,6 +14,13 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom"
fi
+# Set ZSH_CACHE_DIR to the path where cache files sould be created
+# or else we will use the default cache/
+if [[ -z "$ZSH_CACHE_DIR" ]]; then
+ ZSH_CACHE_DIR="$ZSH/cache/"
+fi
+
+
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index bc36c80db..e472578b0 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -4,8 +4,8 @@
# Flag indicating if we've previously jumped to last directory.
typeset -g ZSH_LAST_WORKING_DIRECTORY
-mkdir -p "$ZSH/cache"
-local cache_file="$ZSH/cache/last-working-dir"
+mkdir -p $ZSH_CACHE_DIR
+local cache_file="$ZSH_CACHE_DIR/last-working-dir"
# Updates the last directory once directory is changed.
function chpwd() {
diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
index 3f44b99c6..cde9ebeca 100644
--- a/plugins/zsh_reload/zsh_reload.plugin.zsh
+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
@@ -1,7 +1,7 @@
# reload zshrc
function src()
{
- local cache="$ZSH/cache"
+ local cache=$ZSH_CACHE_DIR
autoload -U compinit zrecompile
compinit -d "$cache/zcomp-$HOST"