This repository has been archived on 2023-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
2021-01-17 20:15:52 +00:00

59 lines
1.7 KiB
Bash

# General options
setopt autocd
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
HISTFILE="${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/history"
HISTSIZE=10000000
SAVEHIST=10000000
[[ !( -f "${HISTFILE}" ) ]] && mkdir -p $(dirname ${HISTFILE})
setopt HIST_IGNORE_DUPS
# Completion
autoload -Uz compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots) # Include hidden files
# Colors
autoload -U colors && colors
# Prompt
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
bindkey -v
export KEYTIMEOUT=1
# Aliases
source "${XDG_CONFIG_HOME:-${HOME}/.config}/.aliasrc"
# Autosuggest
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
# History substring search
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 'j' history-substring-search-down
# Highlighting
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
# Enhanced vim mode
MODE_INDICATOR=""
MODE_CURSOR_VIINS="#b77ee0 blinking bar"
MODE_CURSOR_REPLACE="$MODE_CURSOR_VIINS #ff3334"
MODE_CURSOR_VICMD="#b77ee0 block"
MODE_CURSOR_SEARCH="#e7c547 steady underline"
MODE_CURSOR_VISUAL="$MODE_CURSOR_VICMD steady bar"
MODE_CURSOR_VLINE="$MODE_CURSOR_VISUAL #54ced6"
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'