51 lines
1.6 KiB
Bash
51 lines
1.6 KiB
Bash
# Main zsh settings. env in ~.zprofile
|
|
# Read after .zprofile
|
|
|
|
# source global shell alias & variable files
|
|
[ -f "$XDG_CONFIG_HOME/shell/alias" ] && source "$XDG_CONFIG_HOME/shell/alias"
|
|
[ -f "$XDG_CONFIG_HOME/shell/vars" ] && source "$XDG_CONFIG_HOME/shell/vars"
|
|
|
|
# load modules
|
|
zmodload zsh/complist
|
|
autoload -U compinit && compinit
|
|
autoload -U colors && colors
|
|
|
|
# completion options
|
|
zstyle ':completion:*' menu select # tab opens completion menu
|
|
zstyle ':completion:*' special-dirs true # show ./ and ../
|
|
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} ma=0\;33 # colorize completion menu
|
|
|
|
# main options
|
|
setopt append_history inc_append_history share_history # better history - history appeneded on exit and shared across sessions
|
|
setopt auto_param_slash # add the / when autocompleting a dir
|
|
setopt no_case_glob no_case_match # case insensitive autocomplete
|
|
setopt globdots # include dotfiles
|
|
setopt extended_glob # match ~ # ^
|
|
setopt interactive_comments # allow comments in the shell
|
|
unsetopt prompt_sp # don't autoclean blank lines
|
|
stty stop undef # disable accidential ctrl s
|
|
|
|
# history options
|
|
HISTSIZE=100000
|
|
SAVEHIST=100000
|
|
HISTFILE="$XDG_CACHE_HOME/zsh_history" # move histfile to cache
|
|
HISTCONTROL=ignoreboth # consecutive duplicates & commands starting with space are not saved
|
|
|
|
# fzf setup
|
|
source <(fzf --zsh)
|
|
|
|
# keybinds
|
|
bindkey "^a" beginning-of-line
|
|
bindkey "^e" end-of-line
|
|
bindkey "^R" fzf-history-widget
|
|
bindkey "^[[A" history-beginning-search-backward
|
|
bindkey "^[[B" history-beginning-search-forward
|
|
|
|
# setup prompt - starship
|
|
eval "$(starship init zsh)"
|
|
|
|
# syntax highlighting
|
|
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
|
|
|