2021-04-08 19:59:58 +02:00
|
|
|
# vim:ft=zsh ts=2 sw=2 sts=2
|
2017-07-14 21:20:20 +02:00
|
|
|
# Check for update, set DISABLE_UPDATE_PROMPT=yes to disable the prompt and automatically update
|
2020-12-08 14:47:55 +01:00
|
|
|
env DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f "$DOTFILES/check_for_update.sh"
|
2017-07-14 21:20:20 +02:00
|
|
|
|
2020-12-03 20:24:31 +01:00
|
|
|
# theme-related variables
|
2020-12-07 17:19:28 +01:00
|
|
|
export ZSH_CUSTOM="$DOTFILES"
|
2020-02-27 18:19:52 +01:00
|
|
|
export ZSH_THEME="brethil"
|
2020-12-03 20:24:31 +01:00
|
|
|
export DISABLE_UNTRACKED_FILES_DIRTY=true
|
|
|
|
export VIRTUAL_ENV_DISABLE_PROMPT=true
|
2020-02-27 18:19:52 +01:00
|
|
|
|
2020-12-08 14:32:55 +01:00
|
|
|
_ZSH_CACHE="${HOME}/.cache/zsh"
|
2020-12-08 22:17:28 +01:00
|
|
|
if [[ ! -d "${_ZSH_CACHE}" ]]; then mkdir -p "${_ZSH_CACHE}"; fi
|
2020-12-08 14:32:55 +01:00
|
|
|
|
|
|
|
# Source all zsh plugins
|
2020-12-03 20:24:31 +01:00
|
|
|
source <(antibody init)
|
2021-01-15 01:34:40 +01:00
|
|
|
export ANTIBODY="$(antibody home)"
|
2020-12-06 01:32:04 +01:00
|
|
|
antibody bundle < "$DOTFILES/antibody_plugins.txt"
|
2020-02-27 18:32:19 +01:00
|
|
|
uname="$(uname -a)"
|
|
|
|
if [[ $uname == *"ARCH"* || $uname == *"MANJARO"* ]]; then
|
2020-12-06 01:32:04 +01:00
|
|
|
antibody bundle < "$DOTFILES/antibody_plugins_arch.txt"
|
2020-02-27 18:32:19 +01:00
|
|
|
fi
|
2021-04-08 19:56:49 +02:00
|
|
|
if [[ -n "$_DOTFILES_EXTRA_PLUGINS" ]]; then
|
|
|
|
antibody bundle < "$DOTFILES/antibody_plugins_extra.txt"
|
|
|
|
fi
|
2020-02-27 18:32:19 +01:00
|
|
|
|
2020-12-08 15:18:28 +01:00
|
|
|
# Setup oh-my-zsh path
|
|
|
|
export ZSH="$(antibody path robbyrussell/oh-my-zsh)"
|
|
|
|
|
2020-02-14 16:37:49 +01:00
|
|
|
# Enable zsh autocorrection
|
|
|
|
setopt CORRECT_ALL
|
|
|
|
|
2020-03-13 21:33:14 +01:00
|
|
|
# share history across multiple zsh sessions
|
|
|
|
setopt SHARE_HISTORY
|
|
|
|
# append to history
|
|
|
|
setopt APPEND_HISTORY
|
|
|
|
|
|
|
|
# adds commands as they are typed, not at shell exit
|
|
|
|
setopt INC_APPEND_HISTORY
|
|
|
|
|
|
|
|
# Execute commands without verifying after prompt substitution (!!, !$, etc)
|
|
|
|
setopt NO_HIST_VERIFY
|
|
|
|
|
2019-12-07 22:28:16 +01:00
|
|
|
## Misc environment variables
|
2020-02-14 16:37:43 +01:00
|
|
|
|
2017-07-17 02:00:15 +02:00
|
|
|
# https://www.xkcd.com/378/
|
2020-02-12 17:54:07 +01:00
|
|
|
export EDITOR="vim" # if antibody_plugins.txt includes robbyrussell/oh-my-zsh path:plugins/vi-mode, this also sets `bindkey -v`
|
2021-01-15 01:34:10 +01:00
|
|
|
export VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true # refresh prompt on every mode change
|
2020-04-06 19:45:22 +02:00
|
|
|
# Fix delete (delete! not backspace) key
|
|
|
|
bindkey -a '^[[3~' delete-char
|
|
|
|
|
2020-02-27 18:44:23 +01:00
|
|
|
export KEYTIMEOUT=1 # reduce the transition time between vim modes to 0.1s
|
2020-02-14 16:37:42 +01:00
|
|
|
|
2020-02-14 16:37:43 +01:00
|
|
|
export HISTSIZE=100000
|
|
|
|
export LANG=en_US.UTF-8
|
2020-03-09 17:54:02 +01:00
|
|
|
export LC_ALL=en_US.UTF-8
|
|
|
|
|
2020-12-04 02:56:45 +01:00
|
|
|
# less options
|
2021-04-08 20:02:37 +02:00
|
|
|
export LESS='-xRF-j12' # -j12: displays 12 lines before search results with / and ?
|
2020-03-09 17:54:02 +01:00
|
|
|
if [[ "$(command -v bat)" ]]; then
|
2019-12-07 22:28:16 +01:00
|
|
|
alias cat=bat
|
2021-04-08 18:50:37 +02:00
|
|
|
export BAT_THEME="gruvbox-dark"
|
2020-12-04 02:56:45 +01:00
|
|
|
export BAT_PAGER="less $LESS"
|
2019-12-07 22:28:16 +01:00
|
|
|
export PAGER=bat
|
|
|
|
fi
|
2020-02-14 16:37:47 +01:00
|
|
|
|
2020-02-14 16:37:44 +01:00
|
|
|
if [[ $SSH_CLIENT ]]; then
|
|
|
|
export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
|
|
|
|
fi
|
2020-02-14 16:37:43 +01:00
|
|
|
|
2019-12-07 22:32:14 +01:00
|
|
|
alias esource='$EDITOR $HOME/.zshrc'
|
|
|
|
alias resource='source $HOME/.zshrc'
|
|
|
|
alias dotedit='$EDITOR $DOTFILES/brethil_dotfile.sh'
|
2017-07-17 02:00:15 +02:00
|
|
|
# Custom definitions files
|
2019-12-07 22:32:14 +01:00
|
|
|
alias funedit='$EDITOR ~/.dotfiles_functions.sh'
|
|
|
|
alias aledit='$EDITOR ~/.dotfiles_aliases.sh'
|
2017-06-12 16:22:05 +02:00
|
|
|
|
2020-12-09 01:11:29 +01:00
|
|
|
export p="${HOME}/projects"
|
|
|
|
|
2017-06-12 16:22:05 +02:00
|
|
|
# Extras
|
2021-04-08 20:02:37 +02:00
|
|
|
functions_file=$DOTFILES/functions.sh # Function definitions
|
|
|
|
aliases_file=$DOTFILES/aliases.sh # Aliases definitions
|
|
|
|
colors_file=$DOTFILES/colors.sh # Colors definitions
|
2017-06-12 16:22:05 +02:00
|
|
|
|
|
|
|
# Source extras
|
2020-12-06 01:32:04 +01:00
|
|
|
if [ -f "$functions_file" ]; then source "$functions_file"; else echo "[brethil-dotfiles] Couldn't load functions: $functions_file"; fi
|
|
|
|
if [ -f "$aliases_file" ]; then source "$aliases_file"; else echo "[brethil-dotfiles] Couldn't load aliases: $aliases_file"; fi
|
2021-04-08 20:02:37 +02:00
|
|
|
if [ -f "$colors_file" ]; then source "$colors_file"; else echo "[brethil-dotfiles] Couldn't load colors: $colors_file"; fi
|
2017-06-12 16:22:05 +02:00
|
|
|
|
|
|
|
### SETUP PATHS ####
|
2017-07-14 21:20:20 +02:00
|
|
|
export PATH=$PATH:$HOME/bin
|