dotfiles/brethil_dotfile.sh

83 lines
2.3 KiB
Bash
Executable File

# Check for update, set DISABLE_UPDATE_PROMPT=yes to disable the prompt and automatically update
env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT DOTFILES=$DOTFILES zsh -f $DOTFILES/check_for_update.sh
# antigen plugins
antigen_plugins="git
vi-mode
common-alias
sudo
zsh-navigation-tools
colored-man-pages
zdharma/fast-syntax-highlighting
zsh-users/zsh-autosuggestions
djui/alias-tips
"
uname=$(uname -a)
if [[ $uname == *"Darwin"* ]]; then
os_extra="osx"
elif [[ $uname == *"ARCH"* || $uname == *"MANJARO"* ]]; then
os_extra="archlinux systemd"
elif [[ $uname == *"Debian"* ]]; then
os_extra="debian systemd"
fi
plugins="$antigen_plugins $os_extra"
antigen use oh-my-zsh
antigen bundles <<EOBUNDLES
$plugins
EOBUNDLES
theme=brethil
antigen theme $theme
antigen apply
# Enable zsh autocorrection
setopt CORRECT_ALL
# Enable tab completion for the whole command
zstyle ':completion:*' matcher-list 'l:|=* r:|=*'
## Misc environment variables
# https://www.xkcd.com/378/
export EDITOR="vim"
export KEYTIMEOUT=1 # reduce the transition time between vim modes to 0.1s
export HISTSIZE=100000
export LANG=en_US.UTF-8
if [[ $(command -v bat) ]]; then
alias cat=bat
export BAT_PAGER="less -RF"
export PAGER=bat
else
# less options
export LESS='-R-j12' # displays 12 lines before search results with / and ?
fi
if [[ $SSH_CLIENT ]]; then
export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
fi
alias esource='$EDITOR $HOME/.zshrc'
alias resource='source $HOME/.zshrc'
alias dotedit='$EDITOR $DOTFILES/brethil_dotfile.sh'
# Custom definitions files
alias funedit='$EDITOR ~/.dotfiles_functions.sh'
alias aledit='$EDITOR ~/.dotfiles_aliases.sh'
# Extras
functions_file=$DOTFILES/functions.sh # Function definitions
aliases_file=$DOTFILES/aliases.sh # Aliases definitions
colors_file=$DOTFILES/colors.sh # Colors definitions
# Source extras
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
if [ -f $colors_file ]; then source $colors_file; else echo "[brethil-dotfiles] Couldn't load colors: $colors_file";fi
### SETUP PATHS ####
export PATH=$PATH:$HOME/bin