Files
dotfiles/zshrc
2022-12-06 15:39:59 +02:00

97 lines
3.3 KiB
Bash

# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
# shellcheck shell=bash
LOCAL_BIN="$HOME/.local/bin"
PYTHON_38="$HOME/Library/Python/3.8/bin"
COMPOSER_DIR="$HOME/.composer/vendor/bin"
USR_SBIN=/usr/local/sbin
export PATH="/opt/homebrew/bin:$USR_SBIN:$PATH"
if [ command -v brew &> /dev/null ]; then
BREW_BIN=$(brew --prefix)/bin
BREW_SBIN=$(brew --prefix)/sbin
# PHP_74=$(brew --prefix php@7.4)/bin
# PHP_80=$(brew --prefix php@8.0)/bin
# PHP_CUR=$(brew --prefix php)/bin
BREW_PYTHON=$(brew --prefix python@3.8)/bin
GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin
BREW_RUBY=$(brew --prefix ruby)/bin
BREW_GEMS=$(gem environment gemdir)/bin
export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$BREW_BIN:$BREW_SBIN:$PATH"
fi
export PATH="$LOCAL_BIN:$PYTHON_38:$COMPOSER_DIR:$PATH"
export HIST_STAMPS="yyyy-mm-dd"
export NVM_DIR="$HOME/.nvm"
export NVM_LAZY_LOAD=true
export NVM_COMPLETION=true
export NVM_AUTO_USE=true
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
[[ -f "$HOME/.dotfiles/alias" ]] && source "$HOME/.dotfiles/alias"
# Try to load antigen, if present
[[ -f "$HOME/.config/antigen.zsh" ]] && source "$HOME/.config/antigen.zsh"
# antigen is present
if command -v antigen &> /dev/null; then
antigen use oh-my-zsh
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen bundle ssh-agent
antigen bundle colored-man-pages
antigen bundle jreese/zsh-titles
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle MichaelAquilina/zsh-you-should-use
antigen bundle unixorn/autoupdate-antigen.zshplugin
# antigen bundle git-auto-fetch
hash php 2>/dev/null && antigen bundle php
hash nvm 2>/dev/null && antigen bundle nvm
hash docker 2>/dev/null && antigen bundle docker
hash nvm 2>/dev/null && antigen bundle Sparragus/zsh-auto-nvm-use
hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin
hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin
# antigen bundle voronkovich/phpcs.plugin.zsh
# Platform dependant bundles
if [[ $(uname) == 'Linux' ]]; then
antigen bundle command-not-found
elif [[ $(uname) == 'Darwin' ]]; then
# If we have brew installed
if command -v brew &> /dev/null; then
# Only enable brew plugin if brew exists
antigen bundle brew
# load Z
[[ -f "$(brew --prefix z)/etc/profile.d/z.sh" ]] && source "$(brew --prefix z)/etc/profile.d/z.sh"
fi
fi
antigen apply
fi
# op (1Password cli) is present
if hash op 2>/dev/null; then
eval "$(op completion zsh)"; compdef _op op
fi
# gcloud is present
if hash gcloud 2>/dev/null; then
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
fi
# Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"