diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..e93344d --- /dev/null +++ b/.zshrc @@ -0,0 +1,2 @@ +export ZSH_CONFIG_DIR="${ZDOTDIR}" +source "${ZSH_CONFIG_DIR}/init.zsh" diff --git a/clean-home.zsh b/clean-home.zsh new file mode 100644 index 0000000..7966f49 --- /dev/null +++ b/clean-home.zsh @@ -0,0 +1,51 @@ +# XDG standard +export XDG_DATA_HOME="${HOME}/.local/share" +export XDG_CONFIG_HOME="${HOME}/.config" +export XDG_STATE_HOME="${HOME}/.local/state" +export XDG_CACHE_HOME="${HOME}/.cache" + +# Android studio and cli +export ANDROID_HOME="${XDG_DATA_HOME}/android" + +# Cargo +export CARGO_HOME="${XDG_DATA_HOME}/cargo" + +# Cuda cache +export CUDA_CACHE_PATH="${XDG_CACHE_HOME}/nv" + +# GnuPG +export GNUPGHOME="${XDG_DATA_HOME}/gnupg" + +# Go +export GOPATH="${XDG_DATA_HOME}/go" + +# Gradle +export GRADLE_USER_HOME="${XDG_DATA_HOME}/gradle" + +# GTK2 +export GTK2_RC_FILES="${XDG_CONFIG_HOME}/gtk-2.0/gtkrc" + +# Less history +[[ -d "${XDG_CACHE_HOME}/less" ]] || mkdir "${XDG_CACHE_HOME}/less" +export LESSHISTFILE="${XDG_CACHE_HOME}/less/history" + +# Maxima +export MAXIMA_USERDIR="${XDG_CONFIG_HOME}/maxima" + +# NPM +export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME}/npm/npmrc" + +# Pass +export PASSWORD_STORE_DIR="${XDG_DATA_HOME}/pass" + +# Python and python history +export PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/pythonrc" + +# SQLite history +export SQLITE_HISTORY="${XDG_CACHE_HOME}/sqlite_history" + +# Wine +export WINEPREFIX="${XDG_DATA_HOME}/wine" + +# XAuthority +export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority diff --git a/init.zsh b/init.zsh index a7340ed..9e08a28 100644 --- a/init.zsh +++ b/init.zsh @@ -1,7 +1,8 @@ # Main zsh config file # Enable completions -autoload -U compinit && compinit +autoload -U compinit +compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION" # Some utility stuff ZSH_PLUGIN_DIR="${ZSH_CONFIG_DIR}/plugins" @@ -21,6 +22,9 @@ function source_user_file { [ -e "${ZSH_USER_DIR}/${1}" ] && source "${ZSH_USER_DIR}/${1}" } +# Clean up home directory +source "${ZSH_CONFIG_DIR}/clean-home.zsh" + # Load user early init file source_user_file "early-init.zsh"