82 lines
2.4 KiB
Bash
82 lines
2.4 KiB
Bash
# ██
|
|
# ██
|
|
# ██████ ██████░██
|
|
# ░░░░██ ██░░░░ ░██████░
|
|
# ██ ░░█████ ░██░░░██░
|
|
# ██ ░░░░░██░██ ░██░
|
|
# ██████ ██████ ░██ ░██░
|
|
# ░░░░░░ ░░░░░░ ░░░ ░░░
|
|
|
|
#------------------------------
|
|
# Source config files
|
|
#------------------------------
|
|
for file in ${ZDOTDIR}/{.zaliases,.zshenv}; do
|
|
. $file || { print "$file: cannot source file" && setopt warncreateglobal }
|
|
done
|
|
|
|
# Host specific config
|
|
for file in ${ZDOTDIR}/hosts/${HOST}/{.zshenv,.zshrc,.zaliases}; do
|
|
[[ -r $file ]] && . $file
|
|
done
|
|
|
|
ZSH_THEME="spaceship"
|
|
|
|
# Auto completion
|
|
autoload -Uz compinit
|
|
typeset -i updated_at=$(date +'%j' -r ~/.zcompdump 2>/dev/null || stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)
|
|
if [ $(date +'%j') != $updated_at ]; then
|
|
compinit -i
|
|
else
|
|
compinit -C -i
|
|
fi
|
|
|
|
# Load complist module
|
|
zmodload -i zsh/complist
|
|
|
|
# Save history
|
|
HISTFILE=$HOME/.zsh_history
|
|
HISTSIZE=100000
|
|
SAVEHIST=$HISTSIZE
|
|
|
|
# No duplicates in history
|
|
setopt hist_ignore_all_dups # remove older duplicate entries from history
|
|
setopt hist_reduce_blanks # remove superfluous blanks from history items
|
|
setopt inc_append_history # save history entries as soon as they are entered
|
|
setopt share_history # share history between different instances of the shell
|
|
|
|
# Auto correction
|
|
setopt correct_all # autocorrect commands
|
|
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
|
|
|
|
#oh-my-zsh plugins
|
|
plugins=(
|
|
git
|
|
zsh-autosuggestions
|
|
zsh-syntax-highlighting
|
|
archlinux
|
|
sudo
|
|
tmux
|
|
yadm
|
|
)
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
# My scripts
|
|
PATH=/usr/local/bin:/home/hate/.local/bin:/home/hate/.config/Scripts:/home/hate/.gem/ruby/2.5.0/bin:$PATH
|
|
|
|
# Wpg restore on terminals
|
|
(cat ~/.config/wpg/sequences &)
|
|
|
|
#FASD
|
|
eval "$(fasd --init auto)"
|
|
|
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
|
|
|
# The next line updates PATH for the Google Cloud SDK.
|
|
if [ -f '/home/hate/google-cloud-sdk/path.zsh.inc' ]; then source '/home/hate/google-cloud-sdk/path.zsh.inc'; fi
|
|
|
|
# The next line enables shell command completion for gcloud.
|
|
if [ -f '/home/hate/google-cloud-sdk/completion.zsh.inc' ]; then source '/home/hate/google-cloud-sdk/completion.zsh.inc'; fi
|