Added documentation for xmspa function, MSC/MSW environment variables, bashrc_local_example template, and various missing aliases (git, todo, journal shortcuts). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
5.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a personal development environment setup repository containing:
- Shell scripts for automated installation of development tools
- Dotfiles for bash, vim, tmux, git, psql, and pspg
- The main
setup_env.shscript deploys dotfiles as symlinks and installs base packages
Key Commands
Environment Setup
# Initial setup - installs packages, plugin managers, and creates symlinks
./setup_env.sh
# Individual tool installations
./install_postgres.sh # PostgreSQL from official repository
./install_python3.sh # Latest Python 3 from deadsnakes PPA
./install_java_dev.sh # SDKMAN for Java development
./install_neovim.sh # Latest Neovim release
./install_visidata.sh # VisiData for terminal data exploration
Git Operations
# Automated commit and push (defined in .bashrc)
vc # git add . && commit with timestamp && push
# Custom git aliases (defined in .gitconfig)
git pushall # Push to all remotes
Architecture
Dotfile Management System
The repository uses symlink-based configuration deployment. When setup_env.sh runs:
- Each dotfile in
dotfiles/is backed up if it exists (to.backup) - A symlink is created from
~/.<filename>to the repository'sdotfiles/.<filename> - This allows version control of configs while keeping them in their expected locations
Critical Files:
dotfiles/.bashrc- Main bash configuration with extensive aliases and functionsdotfiles/.bashrc_local- Machine-specific environment variables (PG, MS connection strings)dotfiles/.bashrc_local_example- Template for setting up machine-specific configsdotfiles/.vimrc- Vim configuration using Vundle plugin managerdotfiles/.tmux.conf- Tmux configuration with vim-style pane navigationdotfiles/.gitconfig- Git configuration with custom log format and vimdiffdotfiles/.psqlrc- PostgreSQL client configurationdotfiles/.pspgconf- pspg (PostgreSQL pager) configuration
Custom Bash Workflow
The .bashrc contains a sophisticated workflow for working with:
Database Query Management:
PostgreSQL workflow:
xnspa()function - Interactive file selector for running PostgreSQL queries through nvim swap files, outputs to VisiData as CSVxnsp- Select and execute SQL file through fzf with pspg outputxns- Select and execute SQL file through fzfPGenvironment variable - psql connection string to database (defined in.bashrc_local)
SQL Server workflow:
xmspa()function - Interactive file selector for SQL Server queries through nvim swap files, outputs to VisiData with pipe-delimited formatxmsp- Select SQL file via fzf, execute with sqlcmd, pipe to pspgxms- Select SQL file via fzf, execute with sqlcmdMSenvironment variable - sqlcmd connection string to SQL Server (defined in.bashrc_local)MSCenvironment variable - sqlcmd connection string with pipe-delimited output format (defined in.bashrc_local)MSWenvironment variable - Windows sqlcmd connection (optional, defined in.bashrc_local)
General:
ons- List open nvim files in current directory tree
Git workflow aliases:
gs- git status short formatga- Interactive git add using fzf for file selectiongx- Interactive git checkout using fzfgr- git reset HEADgc- git commit verbosegd- git difftoolgl- Pretty git log with colors
Todo tracking:
td- Find unchecked todo items using ripgreptdp- Find priority todos (with 🔼 or ⏫)tdtp- Find top priority todos (⏫ only)tdo- Open todo in nvim at exact linetdop- Open priority todo in nvim at exact line
Other useful aliases:
nv- Launch Neovim from custom installation pathcj- Navigate to journal directoryjr- Journal sync (pull, commit, push)hc- Health/care notes sync (pull, push)
Plugin Managers
- Vim: Vundle (installed to
~/.vim/bundle/Vundle.vim) - Tmux: TPM - Tmux Plugin Manager (installed to
~/.tmux/plugins/tpm)- Plugins: tmux-resurrect, jimeh/tmux-themepack
- Bash: bash-git-prompt (installed to
~/.bash-git-prompt)
Package Dependencies
Base packages installed by setup_env.sh:
- tmux, vim, git, pspg, bat, fzf, ripgrep
Important Conventions
Environment Variables
Machine-specific environment variables (database connections, tokens, passwords) belong in dotfiles/.bashrc_local, not .bashrc. This file is sourced by .bashrc and should contain sensitive or machine-specific configuration.
The .bashrc_local file is gitignored for security. Use dotfiles/.bashrc_local_example as a template when setting up a new machine. Copy it to .bashrc_local and fill in your actual credentials.
Symlink Pattern
When modifying dotfiles, remember they are symlinked. Changes are automatically tracked by git since the actual files are in the repository's dotfiles/ directory.
Git Commit Messages
Based on recent commits, this repository uses simple lowercase commit messages describing the change (e.g., "add cargo", "visidata", "install sdkman").