Dotfiles/site-modules/core/files/zshrc
Ade Attwood 1dfe088757 feat(shell): don't load base16 themes when useing WarpTerminal
I have started playing with this terminal and it has all its own themes
and base16 was getting in the way.
2024-03-02 18:25:12 +00:00

135 lines
2.9 KiB
Bash

#
# Stop emacs tramp from hanging when working remotly
#
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
#
# Set oh-my-zsh path
#
export ZSH=$HOME/.oh-my-zsh
#
# Disable applications setting the terminal title globally not just in
# oh-my-zsh as it was previously
#
export DISABLE_AUTO_TITLE=true
#
# Configure oh-my-zsh
#
ZSH_THEME="pygmalion"
ENABLE_CORRECTION="false"
COMPLETION_WAITING_DOTS="true"
#
# Set oh-my-zsh plug-ins
#
# More plug-ins are loaded in ~/.oh-my-zsh/custom/lib/misc.zsh file so we dint
# have to define all of the custom installed plug ins here.
#
plugins=(git extract)
#
# map ecs to caps lock
#
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
#
# Change cursor shape
#
# Block ▇ printf '\033[1 q'
# Underline _ printf '\033[3 q'
# Beam | printf '\033[5 q'
#
printf '\033[5 q'
#
# Configure base16 shell for colors if the terminal is not running inside of
# emacs or vim
#
if [[ -z "$VIM" ]] && [[ -z "$INSIDE_EMACS" ]] && [[ "$TERM_PROGRAM" != "WarpTerminal" ]] && [[ -z "$SSH_TTY" ]] ; then
export BASE16_SHELL_ENABLE_VARS=1
BASE16_CONFIG_PATH="$HOME/.config/base16-shell/"
[ -s "$BASE16_CONFIG_PATH/profile_helper.sh" ] && source "$BASE16_CONFIG_PATH/profile_helper.sh"
fi
#
# Setup and export $PATH
#
if [ -d $HOME/.local/share/go ]; then
export PATH=$PATH:$HOME/.local/share/go/bin
fi
if [ -d $HOME/.local/bin ]; then
export PATH=$PATH:$HOME/.local/bin
fi
if [ -d $HOME/development/flutter ]; then
export PATH=$PATH:$HOME/development/flutter/bin
fi
export PATH=$PATH:$HOME/.config/composer/vendor/bin
#
# Set up golang
#
if [ -d $HOME/Code ]; then
export GOPATH=$HOME/Code
export PATH=$PATH:$GOPATH/bin
fi
export EDITOR="nvim"
#
# Import local alases if the file exists
#
if [ -f ~/.aliases ]; then
source ~/.aliases;
fi
#
# Make vim and vi neovim
#
if type nvim > /dev/null 2>&1; then
alias vim='nvim'
alias vi='nvim'
fi
# Load php env
export PHPENV_ROOT="/home/ade/.phpenv"
if [ -d "${PHPENV_ROOT}" ]; then
export PATH="${PHPENV_ROOT}/bin:${PATH}"
eval "$(phpenv init -)"
fi
# Ruby version manager (RVM), this can be installed for the system or user
# local.
if [ -f "/etc/profile.d/rvm.sh" ]; then
source "/etc/profile.d/rvm.sh"
elif [ -s "$HOME/.rvm/scripts/rvm" ]; then
. "$HOME/.rvm/scripts/rvm"
fi
if [ -d "$HOME/.local/share/adr-tools/src" ]; then
PATH="$PATH:$HOME/.local/share/adr-tools/src"
fi
# Set up the rust dev environment
if [ -f "$HOME/.cargo/env" ]; then
. "$HOME/.cargo/env"
fi
# Node version manager (NVM)
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
# Export the bat theme to integrate with base16 nicely
# https://github.com/sharkdp/bat#highlighting-theme
export BAT_THEME="base16"
#
# Init oh-my-zsh
#
source $ZSH/oh-my-zsh.sh