dotfiles/.config/zsh/.zshrc

62 lines
2.0 KiB
Bash
Raw Normal View History

# `.zshrc' is sourced in interactive shells. It should contain
# commands to set up aliases, functions, options, key bindings, etc.
autoload -U colors && colors
2021-08-23 15:04:59 -04:00
# Set up the prompt
autoload -Uz promptinit
promptinit
prompt adam1
2021-08-23 15:04:59 -04:00
setopt histignorealldups sharehistory
2021-07-03 11:19:37 -04:00
2021-08-23 15:04:59 -04:00
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e
2021-07-04 22:52:54 -04:00
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey -s '^L' '^Uclear^M' # clear using alias
2021-07-04 22:25:42 -04:00
autoload edit-command-line; zle -N edit-command-line
2021-07-03 11:19:37 -04:00
bindkey '^k' edit-command-line
2021-08-23 15:04:59 -04:00
# History
HISTSIZE=1000
SAVEHIST=1000
setopt HIST_REDUCE_BLANKS
HISTFILE=$XDG_CACHE_HOME/zshhistory
# Auto cd
setopt auto_cd
2021-07-04 22:52:54 -04:00
# Aliases
[ -f "$E_SCRIPTS_DIR/aliases.sh" ] && source "$E_SCRIPTS_DIR/aliases.sh"
# zsh-specific aliases
# clear zsh history: Adapted from Novimatrem: https://gitlab.com/Novimatrem/clear-bash-history
alias czh="echo 'Fully clearing history, then exiting...' && cat /dev/null > $XDG_CACHE_HOME/zshhistory && history -p && exit"
2021-07-03 11:19:37 -04:00
2021-07-04 22:52:54 -04:00
# Prompt
2021-08-23 15:04:59 -04:00
# PROMPT="%K{238}%F{104}%n%f%k%K{238}%F{104}@%f%k%K{238}%F{104}%m%f%k%K{238}%F{104}:%2~> %f%k"
2021-07-29 16:51:49 -04:00
2021-08-23 15:04:59 -04:00
# Use modern completion system
autoload -Uz compinit
compinit
2021-07-04 22:52:54 -04:00
2021-08-23 15:04:59 -04:00
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=2
eval "$(dircolors -b)"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=long
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'