From df06d835f375bf087fafab8dc57d232f6eb0109c Mon Sep 17 00:00:00 2001 From: earnest ma Date: Sat, 3 Jul 2021 11:19:37 -0400 Subject: [PATCH] shell --- .config/shell/start.sh | 2 ++ .config/zsh/.zshrc | 29 ++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.config/shell/start.sh b/.config/shell/start.sh index 622a42f..3ab620c 100755 --- a/.config/shell/start.sh +++ b/.config/shell/start.sh @@ -14,6 +14,8 @@ export XDG_CACHE_HOME="$HOME/.cache" export LANG=en_CA.UTF-8 # TZ +export EDITOR=nvim + # functions to add directories to $PATH path_add(){ PATH="$1:$PATH" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 755a1cc..e7b8e6e 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -5,25 +5,37 @@ autoload -U colors && colors setopt auto_cd +# History +setopt EXTENDED_HISTORY +setopt SHARE_HISTORY +setopt APPEND_HISTORY +setopt INC_APPEND_HISTORY +setopt HIST_REDUCE_BLANKS HISTSIZE=10000 SAVEHIST=10000 HISTFILE=$XDG_CACHE_HOME/zshhistory +# Corrections +setopt CORRECT +setopt CORRECT_ALL + +# Completion +fpath=($ZDOTDIR/completions $fpath) autoload -U compinit zstyle ':completion:*' menu select zmodload zsh/complist compinit _comp_options+=(globdots) # include hidden files -echo "Hi" - # edit line in editor w/ ctrl-e (from Luke Smith's .zshrc) autoload edit-command-line; zle -N edit-command-line -bindkey '^e' edit-command-line +bindkey '^k' edit-command-line bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word +bindkey -s '^L' '^Uclear^M' + [ -f "$E_SCRIPTS_DIR/aliases.sh" ] && source "$E_SCRIPTS_DIR/aliases.sh" # Run `git -C .config/zsh/autocomplete pull' to update @@ -31,5 +43,16 @@ source $ZDOTDIR/autocomplete/zsh-autocomplete.plugin.zsh zstyle ':autocomplete:*' min-input 1 zstyle ':autocomplete:*' min-delay 0.25 +# 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" + +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) +setopt prompt_subst +RPROMPT=\$vcs_info_msg_0_ +zstyle ':vcs_info:git:*' formats '%F{240}(%b)%r%f' +zstyle ':vcs_info:*' enable git + # This must be placed at the end source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh