dotfiles/files/zshrc

33 lines
861 B
Bash

#!/bin/zsh
# Set up zsh for interactive use (options, prompt, aliases, etc.)
# Source additional configurations if available.
while read -r f; do [ -f "$f" ] && source "$f"; done <<EOL
${XDG_CONFIG_HOME}/shell/aliases
${XDG_CONFIG_HOME}/shell/solarized
EOL
unset f
# Prevent ctrl-s from freezing the terminal.
stty stop undef
# Save a lot of history in the cache directory.
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
HISTSIZE=1000000
SAVEHIST=1000000
# Use vi mode for line editing.
bindkey -v
# Use beam cursor on each new prompt
precmd() { echo -ne '\e[5 q'; }
# Switch cursor shape depending on editing mode.
zle-keymap-select() {
case $KEYMAP in
vicmd) echo -ne '\e[1 q';; # block cursor for command mode
viins|main) echo -ne '\e[5 q';; # beam cursor for insert mode
esac
}
zle -N zle-keymap-select