From f8bde72337670187675f94247a7b3816bc665492 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Fri, 28 Jul 2023 10:24:03 +0300 Subject: [PATCH] fix(zsh): move base zshrc to config/zsh folder --- base/zshrc | 54 +---------------------------------------------- config/zsh/.zshrc | 52 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 53 deletions(-) create mode 100644 config/zsh/.zshrc diff --git a/base/zshrc b/base/zshrc index f175e51..6f29482 100644 --- a/base/zshrc +++ b/base/zshrc @@ -3,60 +3,8 @@ # this is my zsh config. there are many like it, but this one is mine. # shellcheck shell=bash -export ZDOTDIR="$HOME/.local/state/zsh" +export ZDOTDIR="$HOME/.config/zsh/" mkdir -p "$ZDOTDIR" -autoload -U colors zsh/terminfo -colors -setopt correct - -# Add completion scripts to zsh path -FPATH="~/.config/zsh/completion:$FPATH" -autoload -Uz compinit && compinit -i -compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION" - -# Defaults -export DOTFILES="$HOME/.dotfiles" -# shellcheck source=shared.sh -source "$DOTFILES/scripts/shared.sh" - -# Run x-load-configs in your terminal to reload the files. -function x-load-configs() -{ - # Load the shell dotfiles, and then some: - for file in $DOTFILES/config/{exports,alias,functions}; do - [ -f "$file" ] && source "$file" - [ -f "$file-secret" ] && source "$file-secret" - [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME" - [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret" - done -} -x-load-configs - -# Import ssh keys in keychain -ssh-add -A 2>/dev/null; - -# Try to load antigen, if present -ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh" -[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH" - -# antigen is present -have antigen && { - antigen use oh-my-zsh - - # config/functions - x-default-antigen-bundles - - antigen apply -} - -# starship is present -have starship && eval "$(starship init zsh)" - -[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \ - && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh - -export LESSHISTFILE="$XDG_CACHE_HOME"/less_history - # Fig post block. Keep at the bottom of this file. [[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh" diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc new file mode 100644 index 0000000..383b0ce --- /dev/null +++ b/config/zsh/.zshrc @@ -0,0 +1,52 @@ +autoload -U colors zsh/terminfo +colors +setopt correct + +# Add completion scripts to zsh path +FPATH="~/.config/zsh/completion:$FPATH" +autoload -Uz compinit && compinit -i +compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION" + +# Defaults +export DOTFILES="$HOME/.dotfiles" +# shellcheck source=shared.sh +source "$DOTFILES/scripts/shared.sh" + +# Run x-load-configs in your terminal to reload the files. +function x-load-configs() +{ + # Load the shell dotfiles, and then some: + for file in $DOTFILES/config/{exports,alias,functions}; do + [ -f "$file" ] && source "$file" + [ -f "$file-secret" ] && source "$file-secret" + [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME" + [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret" + done +} +x-load-configs + +# Import ssh keys in keychain +ssh-add -A 2>/dev/null; + +# Try to load antigen, if present +ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh" +[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH" + +# antigen is present +have antigen && { + antigen use oh-my-zsh + + # config/functions + x-default-antigen-bundles + + antigen apply +} + +# starship is present +have starship && eval "$(starship init zsh)" + +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \ + && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh + +export LESSHISTFILE="$XDG_CACHE_HOME"/less_history +