dotfiles/home/.zshrc

68 lines
2.9 KiB
Bash
Raw Normal View History

2021-03-23 20:17:43 +00:00
#!/usr/bin/zsh
# ZSH Options
setopt auto_cd # cd by typing directory name if it's not a command
setopt auto_list # automatically list choices on ambiguous completion
setopt auto_menu # automatically use menu completion
setopt always_to_end # move cursor to end if word had one match
setopt interactivecomments # allow comments in interactive mode
setopt magicequalsubst # enable filename expansion for arguments of form `x=expression`
setopt notify # report the status of background jobs immediately
setopt numericglobsort # sort filenames numerically when it makes sense
#setopt correct_all # autocorrect commands
2021-01-28 22:43:33 +00:00
# ZSH files cleanup
2021-01-28 12:55:28 +00:00
export ZSH_CACHE="$HOME/.cache/zsh"
2021-01-28 22:43:33 +00:00
export ZSH_COMPDUMP="$ZSH_CACHE/zcompdump-$ZSH_VERSION" # for auto/tab completion
2021-07-14 12:45:25 +00:00
[ -f ~/.zsh-update ] && mv ~/.zsh-update $ZSH_CACHE/.zsh-update
[ -f ~/.sudo_as_admin_sucessful ] && rm ~/.sudo_as_admin_successful
[ -f ~/.bash_history ] && rm ~/.bash_history
2021-01-28 22:43:33 +00:00
# History configuration
HISTFILE="$ZSH_CACHE/history"
2020-10-22 16:00:38 +00:00
HISTSIZE=10000
SAVEHIST=10000
2021-04-01 19:45:41 +00:00
setopt appendhistory # save history entries as soon as they are entered
2021-03-23 20:17:43 +00:00
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show commands with history expansion to user before running it
#setopt hist_ignore_dups # ignore duplicated commands history list
#setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTFILE
#setopt share_history # share command history data between terminals
2020-10-22 16:00:38 +00:00
2021-01-29 00:09:31 +00:00
# oh-my-zsh configuration (DISABLED by default, if you want oh-my-zsh, uncomment these)
#export ZSH="/usr/share/oh-my-zsh"
#ZSH_THEME="af-magic"
#UPDATE_ZSH_DAYS=8
#ENABLE_CORRECTION="false"
#source $ZSH/oh-my-zsh.sh # Run oh-my-zsh
2020-10-22 16:00:38 +00:00
2021-03-23 20:17:43 +00:00
# Completion features (tab)
2021-01-28 22:43:33 +00:00
autoload -Uz compinit
zmodload -i zsh/complist
2020-10-22 16:00:38 +00:00
compinit -d $ZSH_COMPDUMP
comp_options+=(globdots)
2021-03-23 20:17:43 +00:00
zstyle ':completion:*' menu select # select completions with arrow keys
2021-01-28 22:43:33 +00:00
zstyle ':completion:*' group-name '' # group results by category
zstyle ':completion:::::' completer _expand _complete _ignored _approximate #enable approximate matches for completio
2021-03-23 20:17:43 +00:00
# Color support
2021-07-08 20:43:49 +00:00
autoload -U colors && colors
2021-01-28 12:55:28 +00:00
2021-01-14 12:38:43 +00:00
# Environmental variable exports, including XDG standard definitions
[ -f ~/.config/sh/environ ] && source ~/.config/sh/environ
2020-10-22 16:00:38 +00:00
# Setup aliases
[ -f ~/.config/sh/aliases ] && source ~/.config/sh/aliases
2021-01-14 12:38:43 +00:00
# Load handlers
[ -f ~/.config/sh/handlers ] && source ~/.config/sh/handlers
2021-01-28 22:43:33 +00:00
# Load key bindings
[ -f ~/.config/sh/keybinds ] && source ~/.config/sh/keybinds
# Load prompt
2021-07-08 20:43:49 +00:00
[ -f ~/.config/sh/prompt ] && . ~/.config/sh/prompt
2020-10-22 16:00:38 +00:00
2021-01-14 12:38:43 +00:00
# Load extensions (should be last)
2021-04-14 18:40:11 +00:00
. /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null # Syntax highlighting
. /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null # Auto suggestions
. /usr/share/autojump/autojump.zsh 2>/dev/null # Auto-Jump
2021-03-23 20:17:43 +00:00