From ffad7e56ea8cd7ec96a1d9c8189e37ff2ca6b66b Mon Sep 17 00:00:00 2001 From: Gabriel Brown Date: Mon, 12 Oct 2026 08:06:20 -0400 Subject: [PATCH] Give the Mac mini a zsh config with the Panama prompt and SSH tmux --- config/zsh/.zshrc | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 config/zsh/.zshrc diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc new file mode 100644 index 0000000..d693424 --- /dev/null +++ b/config/zsh/.zshrc @@ -0,0 +1,54 @@ +#!/usr/bin/env zsh +# The Mac mini's shell. macOS stays on zsh: its bash is 3.2, and +# config/bash/shell leans on Linux-only tools (stat -c, ksshaskpass, the nvm +# profile script), so this is a small zsh counterpart rather than a port. +# Linked to ~/.zshrc. Homebrew's PATH comes from ~/.zprofile (brew shellenv). +export PANAMA_PATH="$HOME/.local/share/Panama" + +export EDITOR="nvim" +export SUDO_EDITOR="$EDITOR" + +export BUN_INSTALL="$HOME/.bun" +export PATH="$HOME/.local/bin:$BUN_INSTALL/bin:$PANAMA_PATH/bin:$PATH" + +# History shared across sessions, so tmux panes see each other's commands. +HISTFILE="$HOME/.zsh_history" +HISTSIZE=50000 +SAVEHIST=50000 +setopt SHARE_HISTORY HIST_IGNORE_DUPS HIST_IGNORE_SPACE + +# Emacs keys, like bash's readline: ctrl-a/e/r work as they do on Linux. +bindkey -e + +autoload -Uz compinit && compinit +[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun" + +# Same SSH behaviour as config/bash/shell: an SSH login lands in a tmux +# session that survives a dropped connection. PANAMA_SSH_TMUX=off opts out. +if [[ -n "$SSH_CONNECTION" && -z "$TMUX" && -o interactive && + "${PANAMA_SSH_TMUX:-on}" != "off" ]] && command -v tmux >/dev/null 2>&1; then + exec tmux new-session -A -s main +fi + +alias c="clear" +alias n="nvim" +alias n.="nvim ." +alias ..="cd .." +alias ...="cd ../.." +alias ....="cd ../../.." +alias letscode="ranger ~/Documents/Documents/Code" +alias commit-repo='git add -A && git commit -m "Update stuff" && git push' +alias ls='eza -lh --group-directories-first --icons=auto' +alias lsa='ls -a' +alias lt='eza --tree --level=2 --long --icons=auto --git' +alias ff="fzf --preview 'bat --style=numbers --color=always {}'" +compress() { tar -czf "${1%/}.tar.gz" "${1%/}"; } +alias decompress="tar -xzf" + +# Xcode cannot sign from an SSH session while the login keychain is locked +# (errSecInternalComponent). Run this once per session before a build. +alias unlock-keychain='security unlock-keychain ~/Library/Keychains/login.keychain-db' + +eval "$(zoxide init zsh)" +source <(fzf --zsh) +eval "$(oh-my-posh init zsh --config "$PANAMA_PATH/config/dot/ohmyposh/gib.omp.json")"