blob: c8344bb00454a36bcf76b511467ad00796f963a1 (
plain) (
tree)
|
|
autoload -U compinit colors zcalc
compinit -d
colors
## Autoload
# chcwd hook to open new shells in same CWD
[ -r /tmp/.cwd ] && cd "$(< /tmp/.cwd)"
set_cwd() {
$(pwd > /tmp/.cwd)
}
autoload -Uz add-zsh-hook
add-zsh-hook chpwd set_cwd
## Options
setopt correct # Auto correct mistakes
setopt extendedglob # Extended globbing. Allows using regular expressions with *
setopt nocaseglob # Case insensitive globbing
setopt rcexpandparam # Array expansion with parameters
setopt nocheckjobs # Don't warn about running processes when exiting
setopt numericglobsort # Sort filenames numerically when it makes sense
setopt nobeep # No beep
setopt appendhistory # Immediately append history instead of overwriting
setopt histignorealldups # If a new command is a duplicate, remove the older one
setopt autocd # if only directory path is entered, cd there
unsetopt beep nomatch notify
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive tab completion
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc)
zstyle ':completion:*' rehash true # automatically find new executables in path
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path $HOME/.zsh/cache
HISTFILE=$HOME/.zhistory
HISTSIZE=1000
SAVEHIST=100000
WORDCHARS=${WORDCHARS//[&.;]} # Don't consider certain characters part of the word
## Keybindings
bindkey -v
## Aliases
[ -f "$HOME/.config/aliasrc" ] && . "$HOME/.config/aliasrc"
## Plugins
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # syntax highlighting
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh # autosuggestions
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
## Git Branch
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
zstyle ':vcs_info:git:*' formats '├ %b'$'\n'
## Prompt
RPROMPT=$'%(?.%t.%? %t)'
PROMPT=$'\n╭ %B$fg[cyan]%(4~|%-1~/.../%2~|%~)%b\n\$vcs_info_msg_0_╰ %# '
|