From e775cbaa776e6d720c39957a0b4128ee7e1130dd Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sat, 7 Jan 2023 18:05:54 +0100 Subject: Prune and improve zshrc - stop loading unneeded zsh modules - use $HISTSIZE from environment - create history directory if it doesn't exist - add "e" alias for $EDITOR --- tw/home/files/zshrc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'tw/home/files/zshrc') diff --git a/tw/home/files/zshrc b/tw/home/files/zshrc index 3bde2704..757f679e 100644 --- a/tw/home/files/zshrc +++ b/tw/home/files/zshrc @@ -6,15 +6,9 @@ if [ -d ~/.guix-home/profile/share/zsh/site-functions ]; then fpath+=(~/.guix-home/profile/share/zsh/site-functions) fi -zmodload zsh/attr -zmodload -F zsh/cap b:cap -zmodload zsh/datetime -zmodload zsh/system -zmodload zsh/terminfo - setopt extendedglob interactivecomments -# So we don't have to call tput. +# So we don't have to call tput. Used in zstyle args below. autoload -Uz colors colors @@ -38,9 +32,9 @@ bindkey '^[[F' vi-end-of-line # end ## History setup # HISTSIZE should be set through Guix's home environment service. -HISTSIZE=10000000 +SAVEHIST=${HISTSIZE=10000000} HISTFILE=${XDG_DATA_HOME:-$HOME/.local/share}/zsh/history -SAVEHIST=$HISTSIZE +[ -e "$HISTFILE" ] || mkdir -p "${HISTFILE%/*}" setopt appendhistory sharehistory incappendhistory extendedhistory histverify histreduceblanks ## Completion setup @@ -89,6 +83,7 @@ else fi ## Aliases +alias e="${VISUAL-$EDITOR}" # Use ASYNC_EDITOR so I can continue using the shell while the editor # remains open in a separate window. alias em="$ASYNC_EDITOR" -- cgit v1.2.3