Update zsh preferences

This commit is contained in:
Jordan Holt 2021-01-17 22:16:54 +00:00
parent c1f1df666b
commit 9af1f7245e

View File

@ -1,49 +1,87 @@
# General options ####
setopt autocd ## zsh configuration
setopt nobgnice # Run bg jobs at normal priority ####
setopt nonotify # Don't notify when bg jobs complete
setopt nobeep
setopt interactive_comments
stty stop undef
# History config ## Aliases
HISTFILE="${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/history" source "${XDG_CONFIG_HOME:-${HOME}/.config}/.aliasrc"
HISTSIZE=10000000
SAVEHIST=10000000
[[ !( -f "${HISTFILE}" ) ]] && mkdir -p $(dirname ${HISTFILE})
setopt HIST_IGNORE_DUPS
# Completion ## Colors
autoload -U colors && colors
## Completion
setopt HASH_LIST_ALL
unsetopt AUTO_NAME_DIRS
autoload -Uz compinit autoload -Uz compinit
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
zmodload zsh/complist zmodload zsh/complist
compinit compinit
_comp_options+=(globdots) # Include hidden files _comp_options+=(globdots) # Include hidden files
# Colors ## Directories
autoload -U colors && colors setopt AUTO_CD
setopt AUTO_PUSHD
setopt CDABLE_VARS
setopt PUSHD_IGNORE_DUPS
setopt PUSHD_SILENT
setopt PUSHD_TO_HOME
# Prompt ## Expansion and globbing
setopt EXTENDED_GLOB
unsetopt GLOB_DOTS
unsetopt NOMATCH
## History
setopt APPEND_HISTORY
setopt BANG_HIST
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_SAVE_NO_DUPS
setopt HIST_VERIFY
setopt INC_APPEND_HISTORY_TIME
HISTFILE="${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/history"
HISTSIZE=1000000
SAVEHIST=1000000
[[ !( -f "${HISTFILE}" ) ]] && mkdir -p $(dirname ${HISTFILE})
## I/O
setopt INTERACTIVE_COMMENTS
setopt MULTIOS
## Jobs
setopt LONG_LIST_JOBS
setopt AUTO_RESUME
unsetopt BG_NICE
unsetopt NOTIFY
unsetopt HUP
unsetopt CHECK_JOBS
## Prompt
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
## Vi mode
bindkey -v bindkey -v
export KEYTIMEOUT=1 export KEYTIMEOUT=1
# Aliases ## Zsh line editor
source "${XDG_CONFIG_HOME:-${HOME}/.config}/.aliasrc" unsetopt BEEP
# Autosuggest
####
## Plugins
####
## Autosuggest
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
# History substring search ## History substring search
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null
bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down bindkey -M vicmd 'j' history-substring-search-down
# Highlighting ## Highlighting
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
# Enhanced vim mode ## Enhanced vim mode
MODE_INDICATOR="" MODE_INDICATOR=""
MODE_CURSOR_VIINS="#b77ee0 blinking bar" MODE_CURSOR_VIINS="#b77ee0 blinking bar"
MODE_CURSOR_REPLACE="$MODE_CURSOR_VIINS #ff3334" MODE_CURSOR_REPLACE="$MODE_CURSOR_VIINS #ff3334"
@ -53,6 +91,9 @@ MODE_CURSOR_VISUAL="$MODE_CURSOR_VICMD steady bar"
MODE_CURSOR_VLINE="$MODE_CURSOR_VISUAL #54ced6" MODE_CURSOR_VLINE="$MODE_CURSOR_VISUAL #54ced6"
source /usr/share/zsh/plugins/zsh-vim-mode/zsh-vim-mode.plugin.zsh 2>/dev/null source /usr/share/zsh/plugins/zsh-vim-mode/zsh-vim-mode.plugin.zsh 2>/dev/null
# Generic keybindings
bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n'
####
## Keybindings
####
stty stop undef
bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n'