From 8273e0ce1545cff6c36a4989320ac44399030fba Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 6 Oct 2016 09:21:16 +1100 Subject: [PATCH] Migrate zsh config to XDG base dir location .zshenv still needs to live in ~ for bootstrapping, but everything else is now squirrelled away in ~/.config/zsh instead. Note that zplug still lives in ~/.zplug - it should be relocated too but hasn't been yet. --- .config/zsh/.zprofile | 1 + .config/zsh/.zshrc | 1 + {.zsh => .config/zsh}/all/functions | 0 {.zsh => .config/zsh}/functions/composer | 0 {.zsh => .config/zsh}/functions/enphp | 0 {.zsh => .config/zsh}/functions/fancy-ctrl-z | 0 {.zsh => .config/zsh}/functions/unphp | 0 {.zsh => .config/zsh}/interactive+login/show_fortune | 0 {.zsh => .config/zsh}/interactive/aliases | 0 {.zsh => .config/zsh}/interactive/bindings | 0 {.zsh => .config/zsh}/interactive/fzf | 0 {.zsh => .config/zsh}/interactive/history | 2 +- .config/zsh/interactive/iterm2 | 1 + {.zsh => .config/zsh}/interactive/options | 0 {.zsh => .config/zsh}/login/editor | 0 {.zsh => .config/zsh}/login/fpath | 2 +- {.zsh => .config/zsh}/login/langs | 0 {.zsh => .config/zsh}/login/path | 0 {.zsh => .config/zsh}/login/skip | 0 {.zsh => .config/zsh}/zplug | 2 +- .config/zsh/zprofile | 1 + .config/zsh/zshenv | 1 + .config/zsh/zshrc | 2 ++ .stow-local-ignore | 1 - .stow-no-fold | 1 - .zprofile | 1 - .zsh/interactive/iterm2 | 1 - .zshenv | 5 ++++- .zshrc | 2 -- 29 files changed, 14 insertions(+), 10 deletions(-) create mode 120000 .config/zsh/.zprofile create mode 120000 .config/zsh/.zshrc rename {.zsh => .config/zsh}/all/functions (100%) rename {.zsh => .config/zsh}/functions/composer (100%) rename {.zsh => .config/zsh}/functions/enphp (100%) rename {.zsh => .config/zsh}/functions/fancy-ctrl-z (100%) rename {.zsh => .config/zsh}/functions/unphp (100%) rename {.zsh => .config/zsh}/interactive+login/show_fortune (100%) rename {.zsh => .config/zsh}/interactive/aliases (100%) rename {.zsh => .config/zsh}/interactive/bindings (100%) rename {.zsh => .config/zsh}/interactive/fzf (100%) rename {.zsh => .config/zsh}/interactive/history (80%) create mode 120000 .config/zsh/interactive/iterm2 rename {.zsh => .config/zsh}/interactive/options (100%) rename {.zsh => .config/zsh}/login/editor (100%) rename {.zsh => .config/zsh}/login/fpath (77%) rename {.zsh => .config/zsh}/login/langs (100%) rename {.zsh => .config/zsh}/login/path (100%) rename {.zsh => .config/zsh}/login/skip (100%) rename {.zsh => .config/zsh}/zplug (95%) create mode 100644 .config/zsh/zprofile create mode 100644 .config/zsh/zshenv create mode 100644 .config/zsh/zshrc delete mode 100644 .stow-no-fold delete mode 100644 .zprofile delete mode 120000 .zsh/interactive/iterm2 delete mode 100644 .zshrc diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile new file mode 120000 index 0000000..018fc86 --- /dev/null +++ b/.config/zsh/.zprofile @@ -0,0 +1 @@ +zprofile \ No newline at end of file diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc new file mode 120000 index 0000000..c8b42f4 --- /dev/null +++ b/.config/zsh/.zshrc @@ -0,0 +1 @@ +zshrc \ No newline at end of file diff --git a/.zsh/all/functions b/.config/zsh/all/functions similarity index 100% rename from .zsh/all/functions rename to .config/zsh/all/functions diff --git a/.zsh/functions/composer b/.config/zsh/functions/composer similarity index 100% rename from .zsh/functions/composer rename to .config/zsh/functions/composer diff --git a/.zsh/functions/enphp b/.config/zsh/functions/enphp similarity index 100% rename from .zsh/functions/enphp rename to .config/zsh/functions/enphp diff --git a/.zsh/functions/fancy-ctrl-z b/.config/zsh/functions/fancy-ctrl-z similarity index 100% rename from .zsh/functions/fancy-ctrl-z rename to .config/zsh/functions/fancy-ctrl-z diff --git a/.zsh/functions/unphp b/.config/zsh/functions/unphp similarity index 100% rename from .zsh/functions/unphp rename to .config/zsh/functions/unphp diff --git a/.zsh/interactive+login/show_fortune b/.config/zsh/interactive+login/show_fortune similarity index 100% rename from .zsh/interactive+login/show_fortune rename to .config/zsh/interactive+login/show_fortune diff --git a/.zsh/interactive/aliases b/.config/zsh/interactive/aliases similarity index 100% rename from .zsh/interactive/aliases rename to .config/zsh/interactive/aliases diff --git a/.zsh/interactive/bindings b/.config/zsh/interactive/bindings similarity index 100% rename from .zsh/interactive/bindings rename to .config/zsh/interactive/bindings diff --git a/.zsh/interactive/fzf b/.config/zsh/interactive/fzf similarity index 100% rename from .zsh/interactive/fzf rename to .config/zsh/interactive/fzf diff --git a/.zsh/interactive/history b/.config/zsh/interactive/history similarity index 80% rename from .zsh/interactive/history rename to .config/zsh/interactive/history index b618f17..8ad3ef0 100644 --- a/.zsh/interactive/history +++ b/.config/zsh/interactive/history @@ -1,5 +1,5 @@ #! zsh -HISTFILE=~/.zsh/zhistory +HISTFILE=$XDG_DATA_HOME/zsh/history HISTSIZE=50000 SAVEHIST=$HISTSIZE diff --git a/.config/zsh/interactive/iterm2 b/.config/zsh/interactive/iterm2 new file mode 120000 index 0000000..500ea45 --- /dev/null +++ b/.config/zsh/interactive/iterm2 @@ -0,0 +1 @@ +../../../../../.iterm2_shell_integration.zsh \ No newline at end of file diff --git a/.zsh/interactive/options b/.config/zsh/interactive/options similarity index 100% rename from .zsh/interactive/options rename to .config/zsh/interactive/options diff --git a/.zsh/login/editor b/.config/zsh/login/editor similarity index 100% rename from .zsh/login/editor rename to .config/zsh/login/editor diff --git a/.zsh/login/fpath b/.config/zsh/login/fpath similarity index 77% rename from .zsh/login/fpath rename to .config/zsh/login/fpath index ce64f1e..6fd6bbd 100644 --- a/.zsh/login/fpath +++ b/.config/zsh/login/fpath @@ -1,5 +1,5 @@ #! zsh -fpath=(~/.zsh/functions $fpath) +fpath=($ZDOTDIR/functions $fpath) # filter out duplicates, nonexistent directories, and . (the current directory) fpath=(${(u)^fpath:#.}(N)) diff --git a/.zsh/login/langs b/.config/zsh/login/langs similarity index 100% rename from .zsh/login/langs rename to .config/zsh/login/langs diff --git a/.zsh/login/path b/.config/zsh/login/path similarity index 100% rename from .zsh/login/path rename to .config/zsh/login/path diff --git a/.zsh/login/skip b/.config/zsh/login/skip similarity index 100% rename from .zsh/login/skip rename to .config/zsh/login/skip diff --git a/.zsh/zplug b/.config/zsh/zplug similarity index 95% rename from .zsh/zplug rename to .config/zsh/zplug index 89837bd..8b062d3 100644 --- a/.zsh/zplug +++ b/.config/zsh/zplug @@ -22,6 +22,6 @@ apply-trapd00r-colors() { zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} } -zplug ~/.zsh/interactive/\*, from:local +zplug $ZDOTDIR/interactive/\*, from:local zplug check || zplug install zplug load diff --git a/.config/zsh/zprofile b/.config/zsh/zprofile new file mode 100644 index 0000000..4449713 --- /dev/null +++ b/.config/zsh/zprofile @@ -0,0 +1 @@ +for f in $ZDOTDIR/login/*(-.N); source $f diff --git a/.config/zsh/zshenv b/.config/zsh/zshenv new file mode 100644 index 0000000..d7bc76b --- /dev/null +++ b/.config/zsh/zshenv @@ -0,0 +1 @@ +for f in $ZDOTDIR/all/*(-.N); source $f diff --git a/.config/zsh/zshrc b/.config/zsh/zshrc new file mode 100644 index 0000000..de6c8e1 --- /dev/null +++ b/.config/zsh/zshrc @@ -0,0 +1,2 @@ +source $ZDOTDIR/zplug +[[ -o login ]] && for f in $ZDOTDIR/interactive+login/*(-.N); source $f diff --git a/.stow-local-ignore b/.stow-local-ignore index 709136a..f06ebd2 100644 --- a/.stow-local-ignore +++ b/.stow-local-ignore @@ -1,3 +1,2 @@ ^/\.git -^/\.stow-no-fold ^/README\.md diff --git a/.stow-no-fold b/.stow-no-fold deleted file mode 100644 index b49df88..0000000 --- a/.stow-no-fold +++ /dev/null @@ -1 +0,0 @@ -.zsh/zhistory diff --git a/.zprofile b/.zprofile deleted file mode 100644 index 1215e1d..0000000 --- a/.zprofile +++ /dev/null @@ -1 +0,0 @@ -for f in ~/.zsh/login/*(-.N); source $f diff --git a/.zsh/interactive/iterm2 b/.zsh/interactive/iterm2 deleted file mode 120000 index a805134..0000000 --- a/.zsh/interactive/iterm2 +++ /dev/null @@ -1 +0,0 @@ -../../../../.iterm2_shell_integration.zsh \ No newline at end of file diff --git a/.zshenv b/.zshenv index 375d910..3a7167f 100644 --- a/.zshenv +++ b/.zshenv @@ -1 +1,4 @@ -for f in ~/.zsh/all/*(-.N); source $f +: ${XDG_CONFIG_HOME:=~/.config} ${XDG_CACHE_HOME:=~/.cache} ${XDG_DATA_HOME:=~/.local/share} +export XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME +: ${ZDOTDIR:=$XDG_CONFIG_HOME/zsh} +source $ZDOTDIR/zshenv diff --git a/.zshrc b/.zshrc deleted file mode 100644 index c6a4845..0000000 --- a/.zshrc +++ /dev/null @@ -1,2 +0,0 @@ -source ~/.zsh/zplug -[[ -o login ]] && for f in ~/.zsh/interactive+login/*(-.N); source $f