Revise zsh config
parent
1c63d52218
commit
4ab09d794a
.config/zsh
|
@ -6,7 +6,6 @@ autoload -U colors && colors
|
||||||
# Set up the prompt
|
# Set up the prompt
|
||||||
autoload -Uz promptinit
|
autoload -Uz promptinit
|
||||||
promptinit
|
promptinit
|
||||||
prompt adam1
|
|
||||||
|
|
||||||
setopt histignorealldups sharehistory
|
setopt histignorealldups sharehistory
|
||||||
|
|
||||||
|
@ -21,41 +20,60 @@ autoload edit-command-line; zle -N edit-command-line
|
||||||
bindkey '^k' edit-command-line
|
bindkey '^k' edit-command-line
|
||||||
|
|
||||||
# History
|
# History
|
||||||
HISTSIZE=1000
|
HISTSIZE=9000
|
||||||
SAVEHIST=1000
|
SAVEHIST=9000
|
||||||
setopt HIST_REDUCE_BLANKS
|
setopt extended_history
|
||||||
|
setopt hist_expire_dups_first
|
||||||
|
setopt hist_reduce_blanks
|
||||||
|
setopt hist_ignore_dups
|
||||||
|
setopt hist_ignore_space
|
||||||
HISTFILE=$XDG_CACHE_HOME/zshhistory
|
HISTFILE=$XDG_CACHE_HOME/zshhistory
|
||||||
|
|
||||||
# Auto cd
|
|
||||||
setopt auto_cd
|
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
[ -f "$E_SCRIPTS_DIR/aliases.sh" ] && source "$E_SCRIPTS_DIR/aliases.sh"
|
[ -f "$E_SCRIPTS_DIR/aliases.sh" ] && source "$E_SCRIPTS_DIR/aliases.sh"
|
||||||
# zsh-specific aliases
|
# zsh-specific aliases
|
||||||
# clear zsh history: Adapted from Novimatrem: https://gitlab.com/Novimatrem/clear-bash-history
|
# 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"
|
alias czh="echo 'Fully clearing history, then exiting...' && cat /dev/null > $XDG_CACHE_HOME/zshhistory && history -p && exit"
|
||||||
|
|
||||||
# Prompt
|
fpath=($ZDOTDIR/completions $fpath)
|
||||||
# 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"
|
_comp_options+=(globdots) # include hidden files
|
||||||
|
|
||||||
# Use modern completion system
|
# reload the zsh session. From OMZ:plugins/zsh_reload
|
||||||
autoload -Uz compinit
|
zreload() {
|
||||||
compinit
|
local cache="$ZSH_CACHE_DIR"
|
||||||
|
autoload -U compinit zrecompile
|
||||||
|
compinit -i -d "$cache/zcomp-$HOST"
|
||||||
|
|
||||||
zstyle ':completion:*' auto-description 'specify: %d'
|
for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do
|
||||||
zstyle ':completion:*' completer _expand _complete _correct _approximate
|
zrecompile -p $f && command rm -f $f.zwc.old
|
||||||
zstyle ':completion:*' format 'Completing %d'
|
done
|
||||||
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'
|
# Use $SHELL if available; remove leading dash if login shell
|
||||||
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
|
||||||
|
}
|
||||||
|
|
||||||
|
# Plugin management
|
||||||
|
[[ -f $ZDOTDIR/znap/znap.zsh ]] ||
|
||||||
|
git clone https://github.com/marlonrichert/zsh-snap $ZDOTDIR/znap
|
||||||
|
|
||||||
|
source $ZDOTDIR/znap/znap.zsh
|
||||||
|
|
||||||
|
znap source marlonrichert/zsh-autocomplete
|
||||||
|
zstyle ':autocomplete:*' min-input 1
|
||||||
|
zstyle ':autocomplete:*' min-delay 0.25
|
||||||
|
|
||||||
|
znap source hlissner/zsh-autopair
|
||||||
|
|
||||||
|
znap source zsh-users/zsh-syntax-highlighting
|
||||||
|
|
||||||
|
PURE_PROMPT_SYMBOL=☣
|
||||||
|
znap prompt sindresorhus/pure
|
||||||
|
zstyle :prompt:pure:git:stash show yes
|
||||||
|
|
||||||
|
znap source MichaelAquilina/zsh-you-should-use
|
||||||
|
|
||||||
|
# auto cd must be set later
|
||||||
|
setopt AUTO_CD
|
||||||
|
|
||||||
|
# Hooks
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
|
Loading…
Reference in New Issue