Skip to content

Instantly share code, notes, and snippets.

@willbchang
Created February 7, 2025 09:14
Show Gist options
  • Save willbchang/000980d6d24eb7019e09216e6fc5a470 to your computer and use it in GitHub Desktop.
Save willbchang/000980d6d24eb7019e09216e6fc5a470 to your computer and use it in GitHub Desktop.
# XDG
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
# https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.cache"
# Zsh
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export HISTFILE="$ZDOTDIR/.zsh_history"
# NPM
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/config"
export NPM_CONFIG_CACHE="$XDG_CACHE_HOME/npm"
# Man
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
# Vim
# https://tlvince.com/vim-respect-xdg
export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
export VIMDOTDIR="$XDG_CONFIG_HOME/vim"
# Python
export PYTHON_HISTORY="$XDG_STATE_HOME/python/history"
# Bun
export BUN_INSTALL="$XDG_CONFIG_HOME/bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# SSH
# https://superuser.com/questions/874901/what-are-the-step-to-move-all-your-dotfiles-into-xdg-directories?noredirect=1&lq=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment