dotfiles/zshrc

182 lines
3.5 KiB
Bash

[[ "${ZSH_DEBUG}" ]] && set -o xtrace
ZSH=$HOME/.oh-my-zsh
ZSH_THEME=dracula
CASE_SENSITIVE="true"
# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment to change how often before auto-updates occur? (in days)
export UPDATE_ZSH_DAYS=3
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want to disable command autocorrection
DISABLE_CORRECTION="true"
# Uncomment following line if you want red dots to be displayed while waiting
# for completion
COMPLETION_WAITING_DOTS="true"
# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
path=(
$HOME/bin
$HOME/go/bin
$HOME/.local/bin
$HOME/.cargo/bin
$HOME/.rbenv/bin
$HOME/.rbenv/shims
$HOME/.phpenv/bin
$HOME/.pyenv/bin
$HOME/.pyenv/bin
$HOME/.yarn/bin
$HOME/perl5/bin
/usr/local/sbin
/usr/local/bin
/usr/bin/vendor_perl
/usr/sbin
/usr/bin
/sbin
/bin
/snap/bin
/usr/games
/usr/local/games
)
plugins=(
archlinux
autoenv
aws
bundler
cabal
command-not-found
cp
docker
gem
git
git-hubflow
golang
heroku
knife
mercurial
pip
postgres
python
rails
rake-fast
rbenv
redis-cli
rsync
ruby
tmux
vagrant
vi-mode
)
fpath=(/usr/local/share/zsh/site-functions $fpath)
source $ZSH/oh-my-zsh.sh
unalias gb &>/dev/null
export VISUAL=vim
# The completion for aws is not compatible with $fpath :scream_cat:
if [[ -f /usr/local/share/zsh/site-functions/_aws ]] ; then
source /usr/local/share/zsh/site-functions/_aws
fi
if [[ -f ~/.local/bin/aws_zsh_completer.sh ]]; then
source ~/.local/bin/aws_zsh_completer.sh
fi
if command -v xdg-open &>/dev/null; then
alias open=xdg-open
fi
unsetopt correct_all
bindkey '^R' history-incremental-search-backward
if which pyenv >/dev/null; then
eval "$(pyenv init - 2>/dev/null)"
fi
if which phpenv >/dev/null; then
eval "$(phpenv init - 2>/dev/null)"
fi
if [[ -f ~/.cargo/env ]]; then
source ~/.cargo/env
fi
if gimme --version &>/dev/null; then
eval "$(gimme '1.13.x')" 2>/dev/null
export GOPATH="$HOME/go"
fi
CDPATH="$HOME/code:$HOME/src:$HOME/Development/src:$HOME/repos"
for prefix in github.com github.com/meatballhat code.google.com/p ; do
CDPATH="$HOME/go/src/$prefix:$CDPATH"
done
export GPG_TTY=$(tty)
function dump-ssh-agent() {
env | awk '/SSH/ {
sub(/=/, "=\"", $1)
sub(/$/, "\"", $1)
print "export " $1
}' | tee ~/.ssh/agent.out
}
function load-ssh-agent() {
source ~/.ssh/agent.out
}
function start-ssh-agent() {
ssh-agent >~/.ssh/agent.out
}
function setup-ssh-agent() {
start-ssh-agent && load-ssh-agent
}
function __maybesource() {
if [[ -f "${1}" ]]; then
if [[ "${2}" == silent ]]; then
source "${1}" &>/dev/null
else
source "${1}"
fi
fi
}
load-ssh-agent &>/dev/null
__maybesource ~/.zshenv
__maybesource ~/google-cloud-sdk/path.zsh.inc
__maybesource ~/google-cloud-sdk/completion.zsh.inc
__maybesource /usr/share/nvm/init-nvm.sh silent
__maybesource /usr/local/opt/nvm/nvm.sh silent
__maybesource ~/.kiex/scripts/kiex
if [[ -f ~/perl5/lib/perl5/local/lib.pm ]]; then
eval "$(perl -I ~/perl5/lib/perl5 '-Mlocal::lib')"
fi
if nvm &>/dev/null; then
nvm use --delete-prefix lts/dubnium --silent
fi
true