My .zshrc dotfile
This is my current .zshrc file:
#
# Turn on prompt expansion
#
# Load other aliases and functions
if [; then
for; do
done
fi
#
# Set up so you don't have to type ``cd`` to get
# into a directory
#
# Set colors for ls
#
# Don't keep commands that start with a space to
# the history log
#
# Define Prompt Colors
BG_ON='%K{233}'
BG_OFF='%k'
FG_ON='%F{#6b560e}'
FG_OFF='%f'
FG_CARET='%F{242}'
FG_DOT='%F{239}'
FG_OK='%F{#0d5715}'
FG_ER='%F{52}'
NEWLINE=$'\n'
#
# Make a display to show if the last command
# was successful or not
#
# Show current git branch if there is one
#
# Show if you're in a python venv
#
# Twitch ID
#
# Set The Prompt
#
# Set up/down arrows based on existing text
#
# Use vim bindings
#
# Exports
# Not using chruby. Using rbenv below
#source $HOMEBREW_PREFIX/opt/chruby/share/chruby/chruby.sh
#source $HOMEBREW_PREFIX/opt/chruby/share/chruby/auto.sh
#chruby ruby-3.1.2
# use for ruby version stuff
# For nvm
[ && \.
# TURNED OFF For now until I learn how how to make
# it not override exact matches in the current directory
# The following lines were added by compinstall
#zstyle ':completion:*' completer _expand _complete _ignored
#zstyle ':completion:*' format 'alfa %d'
#zstyle :compinstall filename '/Users/alan/.zshrc'
#autoload -Uz compinit
#compinit
# End of lines added by compinstall
Notes
- Some lines return just the color codes with no content. That's to keep the padding lined up with the background highlight mechanism
-
I'm keeping my main customizations in external files load in via the
.zsh_aws_tools
directory. They're a lot easier for me to deal with as individual files - I'm set up to avoid saving things into the history file that start with a space, but I still don't type passwords into the command prompt. It's good practice in general but becomes pretty important when you stream to avoid accidentally flashing credentials. I call things directly from my password manager instead
-
I tried using
but didn't like it. When I would tab complete for a file it would offer different directories instead of just going into the single file in the directory I was actually in
-
I had
export TERM=screen-256color
based of some old post but have removed it. Things seem to work fine without it in iTerm2 and tmux as far as I can tell -
I'm using
%K{16}
for the background color instead of%K{0}
because the later is getting overwritten by the color them in iTerm2 - I used to have some git stuff in here, but it slows down the prompt when I'm in larger directories
-
The
FG_OK
andFG_ER
value both need to be the same number of digits. (i.e. either they are both 2 digits or they are both 3 digits). Otherwise, the padding to space out the background line misses one or the other
-- end of line --