From b1ed760c0dc14f89db41a585cc892753e4710dde Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Mon, 8 Sep 2025 15:18:00 -0600 Subject: [PATCH] Add zshrc --- .zshrc | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ backup.sh | 2 +- deploy.sh | 2 +- 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 .zshrc diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..aa1deac --- /dev/null +++ b/.zshrc @@ -0,0 +1,67 @@ +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +setopt prompt_subst +PROMPT='%F{black}%B(%F{red}%~%F{black})%f%b +%F{black}%B(%F{blue}$(/bin/date +"%a %b %e %-I:%M:%S %Z %Y")%F{black})%f%b +%F{black}%B(%F{green}%n%F{black})-> %f%b' +export PATH=/opt/homebrew/bin:$PATH +export PATH="/opt/homebrew/anaconda3/bin:/opt/homebrew/bin:/opt/homebrew/lib:/opt/homebrew/include:/usr/local/bin:$PATH" + +# OS-specific ls colors/flags +if [[ $OSTYPE == darwin* ]]; then + export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd + alias ls='ls -G' + # Run Homebrew without pyenv shims in PATH + alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew' +else + alias ls='ls -h --color=auto' +fi + +export CC=gcc +export CXX=g++ +alias nv='nvim' +alias vim='nvim' +alias did="nvim +'normal Go' +'r!date' ~/.did.txt" +alias sshvalheim='ssh 192.168.1.173' +alias sshminecraft='ssh 192.168.1.232' + + +# Colorized cat variants +alias lcat='pygmentize -g -O style=colorful,linenos=1 | grep -P "^\d\d\d\d:"' +alias ccat='pygmentize -g' +alias hcat='highlight -n -O ansi --force' +alias tcat='highlight -O ansi --force' +alias grep='grep --color' + +alias dc='docker-compose' + +# Functions +gitrestore() { + local file=$1 + if [[ -z $file ]]; then + echo "Please specify a file!" + else + git checkout "$(git rev-list -n 1 HEAD -- "$file")"^ -- "$file" + echo "File: $file restored!" + fi +} + +gitbasebranch() { + echo "$(git show-branch -a \ + | grep '\*' \ + | grep -v "$(git rev-parse --abbrev-ref HEAD)" \ + | head -n1 \ + | sed 's/.*\[\(.*\)\].*/\1/' \ + | sed 's/[\^~].*//')" +} + +# History (zsh uses SAVEHIST instead of HISTFILESIZE) +HISTSIZE=50000 +SAVEHIST=500000 +HISTFILE=$HOME/.zsh_history +# And some useful history options: +setopt APPEND_HISTORY INC_APPEND_HISTORY SHARE_HISTORY + +export TERM=xterm-256color + +. "$HOME/.langflow/uv/env" diff --git a/backup.sh b/backup.sh index 49fff85..f3a4260 100755 --- a/backup.sh +++ b/backup.sh @@ -1,3 +1,3 @@ -cp -rf ~/.inputrc ~/.vim* ~/.python* ~/.bash* ~/bashscripts ~/.pylint* ~/.tmux* ~/.profile ~/.gitconfig . +cp -rf ~/.zshrc ~/.inputrc ~/.vim* ~/.python* ~/.bash* ~/bashscripts ~/.pylint* ~/.tmux* ~/.profile ~/.gitconfig . rm -rf .vim/undo cp -rf ~/.config/nvim .config/ diff --git a/deploy.sh b/deploy.sh index 69e0c30..15aa708 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,2 +1,2 @@ -cp -rf .inputrc .vim* .python* .bash* bashscripts .pylint* .tmux* .profile .gitconfig ~/ +cp -rf .zshrc .inputrc .vim* .python* .bash* bashscripts .pylint* .tmux* .profile .gitconfig ~/ cp -rf .config/* ~/.config/