2021-07-12 12:25:43 -04:00
|
|
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
|
|
|
# Initialization code that may require console input (password prompts, [y/n]
|
|
|
|
# confirmations, etc.) must go above this block; everything else may go below.
|
|
|
|
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
|
|
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
|
|
|
fi
|
|
|
|
|
2021-10-29 10:41:50 -04:00
|
|
|
if [ -e /etc/profile.d/flatpak.sh ]; then
|
|
|
|
source /etc/profile.d/flatpak.sh
|
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
if [ -f "${HOME}/.zshrc.d/init" ]; then
|
|
|
|
source "${HOME}/.zshrc.d/init"
|
2020-06-09 21:14:15 -04:00
|
|
|
fi
|
|
|
|
|
2019-12-06 16:31:10 -05:00
|
|
|
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH}"
|
2020-05-25 13:36:22 -04:00
|
|
|
if [ -d "${HOME}/bin" ]; then
|
|
|
|
export PATH="${HOME}/bin:${PATH}"
|
|
|
|
fi
|
2019-12-06 16:31:10 -05:00
|
|
|
|
2021-05-17 13:58:09 -04:00
|
|
|
if [ -d "${HOME}/.local/bin" ]; then
|
|
|
|
export PATH="${HOME}/.local/bin:$PATH"
|
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
if command -v go &> /dev/null; then
|
|
|
|
GOPATH="$(go env GOPATH)"
|
|
|
|
if [ -d "${GOPATH}" ]; then
|
|
|
|
export GOPATH
|
|
|
|
export PATH="${GOPATH}/bin:${PATH}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-05-17 13:58:09 -04:00
|
|
|
if (( $+commands[tag] )); then
|
|
|
|
export TAG_SEARCH_PROG=ag # replace with rg for ripgrep
|
|
|
|
tag() { command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null }
|
|
|
|
alias ag=tag # replace with rg for ripgrep
|
|
|
|
fi
|
|
|
|
|
2019-12-06 16:31:10 -05:00
|
|
|
# oh-my-zsh {
|
|
|
|
export ZSH="${HOME}/.oh-my-zsh"
|
|
|
|
|
2021-07-12 12:25:43 -04:00
|
|
|
ZSH_THEME="powerlevel10k/powerlevel10k"
|
2019-12-06 16:31:10 -05:00
|
|
|
HYPHEN_INSENSITIVE="true"
|
2021-05-02 23:00:19 -04:00
|
|
|
UPDATE_ZSH_DAYS=7
|
2019-12-06 16:31:10 -05:00
|
|
|
DISABLE_UPDATE_PROMPT="true"
|
|
|
|
HIST_STAMPS="mm/dd/yyyy"
|
2020-05-25 13:36:22 -04:00
|
|
|
plugins=(
|
2020-12-31 12:04:07 -05:00
|
|
|
aws
|
2020-05-25 13:36:22 -04:00
|
|
|
autojump
|
|
|
|
battery
|
|
|
|
brew
|
|
|
|
catimg
|
2021-07-12 12:25:43 -04:00
|
|
|
colorize
|
|
|
|
command-not-found
|
2020-05-25 13:36:22 -04:00
|
|
|
common-aliases
|
|
|
|
copydir
|
|
|
|
copyfile
|
|
|
|
docker
|
2020-08-04 22:12:35 -04:00
|
|
|
docker-compose
|
2020-05-25 13:36:22 -04:00
|
|
|
encode64
|
|
|
|
fzf
|
|
|
|
git
|
|
|
|
git-extras
|
|
|
|
golang
|
|
|
|
grunt
|
|
|
|
helm
|
|
|
|
kube-ps1
|
|
|
|
kubectl
|
|
|
|
minikube
|
|
|
|
node
|
|
|
|
npm
|
|
|
|
osx
|
2020-06-09 09:53:11 -04:00
|
|
|
pass
|
2020-05-25 13:36:22 -04:00
|
|
|
pip
|
|
|
|
pod
|
|
|
|
ssh-agent
|
|
|
|
sudo
|
|
|
|
tmux
|
|
|
|
xcode
|
|
|
|
zsh-autosuggestions
|
|
|
|
zsh-syntax-highlighting
|
|
|
|
)
|
|
|
|
|
2019-12-06 16:31:10 -05:00
|
|
|
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
# }
|
|
|
|
|
|
|
|
# zsh {
|
|
|
|
HISTFILE="${HOME}/.histfile"
|
|
|
|
HISTSIZE=1048576
|
|
|
|
SAVEHIST=1048576
|
|
|
|
setopt \
|
|
|
|
appendhistory \
|
|
|
|
autocd \
|
|
|
|
beep \
|
|
|
|
extendedglob \
|
|
|
|
nomatch \
|
|
|
|
notify \
|
|
|
|
HIST_IGNORE_DUPS \
|
|
|
|
INC_APPEND_HISTORY \
|
|
|
|
SHARE_HISTORY \
|
|
|
|
HIST_REDUCE_BLANKS
|
|
|
|
# }
|
|
|
|
|
|
|
|
# general {
|
|
|
|
export LANG='en_US.UTF-8'
|
|
|
|
export TERM='xterm-256color'
|
|
|
|
export EDITOR='vim'
|
2021-07-12 12:25:43 -04:00
|
|
|
|
2019-12-06 16:31:10 -05:00
|
|
|
# if nvim is installed, effectively replace vim
|
|
|
|
if command -v nvim &> /dev/null; then
|
|
|
|
export EDITOR='nvim'
|
|
|
|
alias vi='nvim'
|
|
|
|
alias vim='nvim'
|
|
|
|
alias vimdiff="nvim -d"
|
|
|
|
alias view="nvim -R"
|
|
|
|
fi
|
2021-07-12 12:25:43 -04:00
|
|
|
|
|
|
|
# if we're in vs code's terminal, set the editor to vs code
|
|
|
|
if [ "${TERM_PROGRAM:-nope}" = "vscode" ]; then
|
|
|
|
export EDITOR='code'
|
|
|
|
export TAG_CMD_FMT_STRING="code --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}"
|
|
|
|
fi
|
|
|
|
|
2019-12-06 16:31:10 -05:00
|
|
|
export VISUAL="${EDITOR}"
|
|
|
|
|
|
|
|
# use reflink cp if supported (yay CoW)
|
2020-05-25 13:36:22 -04:00
|
|
|
if 2>&1 cp --help | grep -q reflink; then
|
2019-12-06 16:31:10 -05:00
|
|
|
alias cp='cp -i --reflink=auto'
|
|
|
|
else
|
|
|
|
alias cp='cp -i'
|
|
|
|
fi
|
2020-12-31 12:04:07 -05:00
|
|
|
|
2019-12-06 16:31:10 -05:00
|
|
|
alias mv='mv -i'
|
|
|
|
|
2021-05-01 18:45:32 -04:00
|
|
|
# if rootless docker has a unix domain socket, use it!
|
|
|
|
if [ -e "${XDG_RUNTIME_DIR}/docker.sock" ]; then
|
|
|
|
export DOCKER_HOST="unix://${XDG_RUNTIME_DIR}/docker.sock"
|
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
if command -v docker-compose &> /dev/null; then
|
|
|
|
alias dco='docker-compose'
|
|
|
|
fi
|
2019-12-06 16:31:10 -05:00
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
if command -v minikube &> /dev/null; then
|
|
|
|
alias mk='minikube'
|
2019-12-06 16:31:10 -05:00
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
if command -v kubectl &> /dev/null; then
|
|
|
|
alias k='kubectl'
|
2019-12-06 16:31:10 -05:00
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
if command -v kubectx &> /dev/null; then
|
|
|
|
alias kctx='kubectx'
|
2019-12-06 16:31:10 -05:00
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
if command -v kubens &> /dev/null; then
|
|
|
|
alias kns='kubens'
|
2019-12-06 16:31:10 -05:00
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
CARGO_ENV="${HOME}/.cargo/env"
|
|
|
|
if [ -f "${CARGO_ENV}" ]; then
|
|
|
|
source "${CARGO_ENV}"
|
2019-12-06 16:31:10 -05:00
|
|
|
fi
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
# add awless autocompletion if available
|
|
|
|
if command -v awless &> /dev/null; then
|
|
|
|
source <(awless completion zsh)
|
2019-12-06 16:31:10 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
if command -v fzf &> /dev/null; then
|
|
|
|
export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l'
|
|
|
|
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
|
|
|
|
fi
|
|
|
|
|
2020-05-25 13:36:22 -04:00
|
|
|
case "$(uname)" in
|
2019-12-06 16:31:10 -05:00
|
|
|
"Darwin")
|
|
|
|
pdf_join() {
|
|
|
|
join_py="/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py"
|
|
|
|
echo -n "Name of output file: "
|
|
|
|
read output_file && "$join_py" -o $output_file $@ && open $output_file
|
|
|
|
}
|
|
|
|
|
|
|
|
if command -v gtar &> /dev/null; then
|
|
|
|
alias tar='gtar'
|
|
|
|
fi
|
2020-12-31 12:04:07 -05:00
|
|
|
|
|
|
|
if command -v gsed &> /dev/null; then
|
|
|
|
alias sed='gsed'
|
|
|
|
fi
|
2019-12-06 16:31:10 -05:00
|
|
|
;;
|
|
|
|
"Linux")
|
|
|
|
alias open="xdg-open"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
# }
|
|
|
|
|
2020-12-31 12:04:07 -05:00
|
|
|
source "${HOME}/.homesick/repos/homeshick/homeshick.sh"
|
|
|
|
homeshick refresh 5 -q
|
|
|
|
|
|
|
|
export NVM_DIR="$HOME/.nvm"
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
|
|
|
|
|
|
# load any file that ends with .zsh or .sh and is executable
|
2019-12-06 16:31:10 -05:00
|
|
|
for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
|
|
|
|
if ! [ -x "${SCRIPT}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
source "${SCRIPT}"
|
|
|
|
done
|
2021-07-12 12:25:43 -04:00
|
|
|
|
|
|
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
|
|
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|