diff --git a/.zsh.d/01-history b/.config/zsh/01-history similarity index 100% rename from .zsh.d/01-history rename to .config/zsh/01-history diff --git a/.zsh.d/02-inline-glob-expansion b/.config/zsh/02-inline-glob-expansion similarity index 100% rename from .zsh.d/02-inline-glob-expansion rename to .config/zsh/02-inline-glob-expansion diff --git a/.zsh.d/03-screen-information-dialog b/.config/zsh/03-screen-information-dialog similarity index 100% rename from .zsh.d/03-screen-information-dialog rename to .config/zsh/03-screen-information-dialog diff --git a/.zsh.d/04-set-up-dotfiles-repo-management b/.config/zsh/04-set-up-dotfiles-repo-management similarity index 100% rename from .zsh.d/04-set-up-dotfiles-repo-management rename to .config/zsh/04-set-up-dotfiles-repo-management diff --git a/.zsh.d/05-set-locale-to-us-utf8 b/.config/zsh/05-set-locale-to-us-utf8 similarity index 100% rename from .zsh.d/05-set-locale-to-us-utf8 rename to .config/zsh/05-set-locale-to-us-utf8 diff --git a/.zsh.d/10-report-time-for-long-running-processes b/.config/zsh/10-report-time-for-long-running-processes similarity index 100% rename from .zsh.d/10-report-time-for-long-running-processes rename to .config/zsh/10-report-time-for-long-running-processes diff --git a/.zsh.d/12-ssh-agent-autoconfiguration b/.config/zsh/12-ssh-agent-autoconfiguration similarity index 100% rename from .zsh.d/12-ssh-agent-autoconfiguration rename to .config/zsh/12-ssh-agent-autoconfiguration diff --git a/.zsh.d/13-command-spelling-correction b/.config/zsh/13-command-spelling-correction similarity index 100% rename from .zsh.d/13-command-spelling-correction rename to .config/zsh/13-command-spelling-correction diff --git a/.zsh.d/15-theme-powerlevel9k b/.config/zsh/15-theme-powerlevel9k similarity index 100% rename from .zsh.d/15-theme-powerlevel9k rename to .config/zsh/15-theme-powerlevel9k diff --git a/.zsh.d/16-install-tmux-plugin-manager b/.config/zsh/16-install-tmux-plugin-manager similarity index 100% rename from .zsh.d/16-install-tmux-plugin-manager rename to .config/zsh/16-install-tmux-plugin-manager diff --git a/.zsh.d/20-essential b/.config/zsh/20-essential similarity index 100% rename from .zsh.d/20-essential rename to .config/zsh/20-essential diff --git a/.zsh.d/21-integrations b/.config/zsh/21-integrations similarity index 100% rename from .zsh.d/21-integrations rename to .config/zsh/21-integrations diff --git a/.zsh.d/22-autocompletions b/.config/zsh/22-autocompletions similarity index 100% rename from .zsh.d/22-autocompletions rename to .config/zsh/22-autocompletions diff --git a/.zsh.d/30-configure-autocompletion b/.config/zsh/30-configure-autocompletion similarity index 100% rename from .zsh.d/30-configure-autocompletion rename to .config/zsh/30-configure-autocompletion diff --git a/.zsh.d/31-deduplicate-path-variable b/.config/zsh/31-deduplicate-path-variable similarity index 100% rename from .zsh.d/31-deduplicate-path-variable rename to .config/zsh/31-deduplicate-path-variable diff --git a/.zsh.d/32-aliases-base b/.config/zsh/32-aliases-base similarity index 100% rename from .zsh.d/32-aliases-base rename to .config/zsh/32-aliases-base diff --git a/.zsh.d/33-alias-mkcd b/.config/zsh/33-alias-mkcd similarity index 100% rename from .zsh.d/33-alias-mkcd rename to .config/zsh/33-alias-mkcd diff --git a/.zsh.d/34-alias-show-newest-files b/.config/zsh/34-alias-show-newest-files similarity index 100% rename from .zsh.d/34-alias-show-newest-files rename to .config/zsh/34-alias-show-newest-files diff --git a/.zsh.d/35-alias-k-to-l b/.config/zsh/35-alias-k-to-l similarity index 100% rename from .zsh.d/35-alias-k-to-l rename to .config/zsh/35-alias-k-to-l diff --git a/.zsh.d/36-disable-enhancd-double-dot b/.config/zsh/36-disable-enhancd-double-dot similarity index 100% rename from .zsh.d/36-disable-enhancd-double-dot rename to .config/zsh/36-disable-enhancd-double-dot diff --git a/.zsh.d/37-alias-ssh-tmux-attaching b/.config/zsh/37-alias-ssh-tmux-attaching similarity index 100% rename from .zsh.d/37-alias-ssh-tmux-attaching rename to .config/zsh/37-alias-ssh-tmux-attaching diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..762de4a --- /dev/null +++ b/.zshenv @@ -0,0 +1,4 @@ +export XDG_CONFIG_DIR="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" + + diff --git a/.zshrc b/.zshrc index fd56867..3b24440 100644 --- a/.zshrc +++ b/.zshrc @@ -1,9 +1,23 @@ #!/bin/zsh -## DEBUG INFORMATION +### DEFAULT DIRECTORY STRUCTURE +# +# ~/ +# - .zshrc > Initial setup, should not need to be changed +# - .bashrc > Bash setup (empty for my dotfiles) +# - .Xresources > Initial Xresources setup, redirects to .config/.Xresources.d/ +# - .tmux > Tmux setup (would love to put this into .config/ ) +# - .config/ > all other (program) configuration should go in this dir +# --------- .zshrc.d/ > The actual zsh setup files, see their configuration below +# --------- .Xresources.d/ > The actual Xresources setup files +# --------- .zgen/ > The zsh plugin manager +# - .dotfiles/ > the version control of dotfiles +# +#### + +## Show debug information # # ZSH_SETUP_SHOW_DEBUG="true" -# # Uncomment the above line to get debug information during the script setup. print_dbg() { if [ -z $ZSH_SETUP_SHOW_DEBUG ]; then @@ -15,17 +29,18 @@ print_dbg() { # Clone zgen if you haven't already check_zgen_installation() { if [[ -z "$ZGEN_PARENT_DIR" ]]; then - ZGEN_PARENT_DIR=$HOME + ZGEN_PARENT_DIR=${${XDG_CONFIG_DIR}:="$HOME/.config/"} + ZGEN_DIR="$ZGEN_PARENT_DIR/zgen" fi - if [[ ! -f $ZGEN_PARENT_DIR/.zgen/zgen.zsh ]]; then + if [[ ! -f $ZGEN_DIR/zgen.zsh ]]; then if [[ ! -d "$ZGEN_PARENT_DIR" ]]; then mkdir -p "$ZGEN_PARENT_DIR" fi pushd $ZGEN_PARENT_DIR - git clone https://github.com/tarjoilija/zgen.git ./.zgen + git clone https://github.com/tarjoilija/zgen.git $ZGEN_DIR popd fi - source $ZGEN_PARENT_DIR/.zgen/zgen.zsh + source $ZGEN_DIR/zgen.zsh unset ZGEN_PARENT_DIR } @@ -65,9 +80,9 @@ check_zgen_installation() { # Set ZSH_CONFIG_DIR to default to ~/.zsh.d, or let user override # Exit early if no configuration directory has been found -if [ ! -d ${ZSH_CONFIG_DIR:="$HOME/.zsh.d"} ]; then +if [ ! -d ${ZSH_CONFIG_DIR:="${XDG_CONFIG_DIR:-$HOME/.config}/zsh"} ]; then # If the user explicitly overrode the path give him an error - if [ ! $ZSH_CONFIG_DIR = "$HOME/.zsh.d" ]; then + if [ ! $ZSH_CONFIG_DIR = "${XDG_CONFIG_DIR:-$HOME/.config/}/zsh" ]; then printf "\$ZSH_CONFIG_DIR=$ZSH_CONFIG_DIR/ does not exist.\n" fi PS1="$HOME $ "