diff --git a/.zshrc b/.zshrc index dc2bc00..760ee59 100644 --- a/.zshrc +++ b/.zshrc @@ -6,7 +6,9 @@ ### Basic shell configuration >>> ### Environment variables >>> { + # optionally source an external environment variable file [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/envrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/envrc" + # Intelligently set $EDITOR if command -v nvim > /dev/null;then export EDITOR=nvim @@ -18,6 +20,10 @@ export PATH="$PATH:${XDG_DATA_HOME:-$HOME/.local/bin}" export SYSTEMD_EDITOR="$EDITOR" + + export LSCOLORS="Gxfxcxdxbxegedabagacad" + export ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/zsh" + # Plugin setting >>> { # ZSH Vi Mode @@ -33,6 +39,7 @@ # <<< ### Aliases >>> { + # optionally source an external alias file [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ## Short hand programs (ex: sc = shellcheck) >>> # use nvim rather than vim if the command exists @@ -123,6 +130,7 @@ # <<< ### Functions >>> { + # optionally source an external function file [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/fnrc" # Simple extraction script. Taken from manjaro's .bashrc @@ -355,7 +363,6 @@ setopt pipe_fail # When a pipe fails, show the non-0 exit code for the exit code } # <<< - ## ZSH Completion Options >>> { # Mine @@ -381,7 +388,6 @@ WORDCHARS=${WORDCHARS//\/[&.;]} # Don't consider certain characters part of the word } # <<< - ## Keybindings >>> bindkey -v # Enable Vi mode bindkey '^[[7~' beginning-of-line # Home key @@ -420,11 +426,7 @@ bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'j' history-substring-search-down # <<< -autoload -U compinit colors zcalc -compinit -d -colors - -# Color man pages >>> +# Colors and compinit >>> export LESS_TERMCAP_mb=$'\E[01;32m' export LESS_TERMCAP_md=$'\E[01;32m' export LESS_TERMCAP_me=$'\E[0m' @@ -433,15 +435,11 @@ export LESS_TERMCAP_so=$'\E[01;47;34m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;36m' export LESS=-R -# <<< -# Offer to install missing package if command is not found >>> -# if [[ -r /usr/share/zsh/functions/command-not-found.zsh ]]; then -# source /usr/share/zsh/functions/command-not-found.zsh -# export PKGFILE_PROMPT_INSTALL_MISSING=1 -# fi +autoload -U compinit colors zcalc +compinit -d +colors # <<< - ### Various manjaro ZSH functions >>> # Set terminal window and tab/icon title