From 962459356be661dce62c739c14b86401b2ed556b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Thu, 1 Sep 2016 14:16:13 +0100 Subject: [PATCH] Improve zsh variable usage --- .profile | 3 ++- .zshrc | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 34b517c..685dff8 100644 --- a/.profile +++ b/.profile @@ -2,7 +2,8 @@ export LC_ALL=en_GB.UTF-8 export LANG=en_GB.UTF-8 export LC_NUMERIC=en_GB -export DOTFILES=~/.config/dotfiles +export CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" +export DOTFILES=$CONFIG_DIR/dotfiles export PATH="${PATH}:$DOTFILES/scripts" export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open diff --git a/.zshrc b/.zshrc index 6b7ffd4..e289796 100644 --- a/.zshrc +++ b/.zshrc @@ -7,7 +7,12 @@ ZSH=/usr/share/oh-my-zsh ZSH_THEME="fishy" DISABLE_AUTO_UPDATE="true" -HISTFILE=~/.config/zsh-histfile +CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" +ZSH_CONFIG_DIR=$CONFIG_DIR/zsh +ZSH_CACHE_DIR=$CONFIG_DIR/oh-my-zsh/cache +mkdir -p $ZSH_CACHE_DIR $ZSH_CONFIG_DIR + +HISTFILE=$ZSH_CONFIG_DIR/histfile HISTSIZE=100000 SAVEHIST=100000 setopt appendhistory autocd extendedglob