1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-23 21:01:58 +00:00

Merge pull request #3478 from stephenrjohnson/custom_cache_dir

Allow custom cache dir
This commit is contained in:
Robby Russell 2015-01-31 06:23:50 -06:00
commit 550ccca91c
4 changed files with 11 additions and 4 deletions

View file

@ -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 \

View file

@ -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

View file

@ -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() {

View file

@ -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"