From 69395b7a0cf409acc44a819c5630b8d4d40a7936 Mon Sep 17 00:00:00 2001 From: earnest ma Date: Sun, 4 Jul 2021 22:52:54 -0400 Subject: [PATCH] * --- .config/zsh/.zshrc | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 80961c8..70a4dcb 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -3,13 +3,14 @@ autoload -U colors && colors +# Options setopt auto_cd # History setopt EXTENDED_HISTORY setopt SHARE_HISTORY setopt APPEND_HISTORY -setopt INC_APPEND_HISTORY +# setopt INC_APPEND_HISTORY # unexpected last result with multiple open terminals setopt HIST_REDUCE_BLANKS HISTSIZE=10000 SAVEHIST=10000 @@ -27,28 +28,32 @@ zmodload zsh/complist compinit _comp_options+=(globdots) # include hidden files -# keybindings: force emacs state -bindkey -e +# Keybindings +bindkey -e # force Emacs state, even with $EDITOR=nvim +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word +bindkey -s '^L' '^Uclear^M' # clear using alias # edit line in editor w/ ctrl-k (from Luke Smith's .zshrc) autoload edit-command-line; zle -N edit-command-line bindkey '^k' edit-command-line -bindkey "^[[1;5C" forward-word -bindkey "^[[1;5D" backward-word - -bindkey -s '^L' '^Uclear^M' - +# Aliases [ -f "$E_SCRIPTS_DIR/aliases.sh" ] && source "$E_SCRIPTS_DIR/aliases.sh" -# Run `git -C .config/zsh/autocomplete pull' to update -source $ZDOTDIR/autocomplete/zsh-autocomplete.plugin.zsh -zstyle ':autocomplete:*' min-input 1 -zstyle ':autocomplete:*' min-delay 0.25 +# 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" # Prompt 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" +# Plugins! I try to keep as few as possible +# Cloned from bootstrap file, run `git -C .config/zsh/autocomplete pull' to update +source $ZDOTDIR/autocomplete/zsh-autocomplete.plugin.zsh +zstyle ':autocomplete:*' min-input 1 +zstyle ':autocomplete:*' min-delay 0.25 + autoload -Uz vcs_info precmd_vcs_info() { vcs_info } precmd_functions+=( precmd_vcs_info ) @@ -59,3 +64,4 @@ zstyle ':vcs_info:*' enable git # This must be placed at the end source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +