summaryrefslogtreecommitdiff
path: root/tw/home/files/zshrc
diff options
context:
space:
mode:
authorTimo Wilken2023-01-07 18:05:54 +0100
committerTimo Wilken2023-01-07 18:05:54 +0100
commite775cbaa776e6d720c39957a0b4128ee7e1130dd (patch)
treed489d9c0f56dcd4e6687cdf482a02fa0266bf097 /tw/home/files/zshrc
parent2db9a6bc019926ad495e8c369cf8cab1f9394235 (diff)
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
Diffstat (limited to 'tw/home/files/zshrc')
-rw-r--r--tw/home/files/zshrc13
1 files changed, 4 insertions, 9 deletions
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"