From 5b53186ad52a156432043869db3bdff1296f4202 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Sat, 24 Aug 2024 12:09:27 -0700 Subject: [PATCH] zsh: add /etc/zsh config files for easier unpacking --- zsh-etcfiles/etc/zsh/zshenv | 14 ++++++++++++++ zsh-etcfiles/etc/zsh/zshrc | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 zsh-etcfiles/etc/zsh/zshenv create mode 100644 zsh-etcfiles/etc/zsh/zshrc diff --git a/zsh-etcfiles/etc/zsh/zshenv b/zsh-etcfiles/etc/zsh/zshenv new file mode 100644 index 0000000..21a464c --- /dev/null +++ b/zsh-etcfiles/etc/zsh/zshenv @@ -0,0 +1,14 @@ +# /etc/zsh/zshenv +# zsh environment variables +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_STATE_HOME="$HOME/.local/state" + +export ZDOTDIR="${XDG_CONFIG_HOME:-$HOME/.config}/zsh" + +# Shell settings +export HISTCONTROL="ignoredups" +export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/zsh_history" +export HISTSIZE=20000 +export SAVEHIST=20000 diff --git a/zsh-etcfiles/etc/zsh/zshrc b/zsh-etcfiles/etc/zsh/zshrc new file mode 100644 index 0000000..1aca73c --- /dev/null +++ b/zsh-etcfiles/etc/zsh/zshrc @@ -0,0 +1,18 @@ +# Zsh options for all users + +# enable extended globbing +setopt extended_glob + +# autoload misc files +for dotfile in "$ZDOTDIR"/*(D); do + source $dotfile +done + +# Check history file +if [[ ! -f "${HISTFILE}" ]]; then + mkdir -p "${HISTFILE%/*}" + touch "${HISTFILE}" +fi + +# vim-like keybindings +bindkey -v