- add telescope_tasks.lua: vault-wide task pickers (<leader>tl / <leader>tL) - track mappings.lua and rename_term.lua in dotfiles - update CLAUDE.md: add vault definition, telescope_tasks entry, nvim lua file list - fix tdo/tdop aliases and ga/gx aliases in .bashrc - install_nvchad.sh: symlink personal nvim modules after clone Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
5.5 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
Personal Linux development environment setup. Clone and run one script to get a consistent shell and editor across machines.
Key Commands
Fresh machine setup
git clone git@gitea.hptrow.me:pt/setup_env.git ~/setup_env
cd ~/setup_env && ./setup_env.sh
setup_env.sh installs packages, downloads Neovim, clones plugin managers, deploys all dotfile symlinks, and sets up NvChad.
Day-to-day sync
cd ~/setup_env && ./sync.sh
Pulls setup_env and nvim config repos, redeploys symlinks. Safe to run anytime.
Optional tool installs (run manually per machine)
./install_postgres.sh # PostgreSQL from official apt repository
./install_python3.sh # Latest Python 3 from deadsnakes PPA (includes python3-venv)
./install_node.sh # Node.js via nvm (needed for prettier formatter in nvim)
./install_java_dev.sh # SDKMAN for Java development
./install_visidata.sh # VisiData for terminal data exploration
./reinstall_nvchad.sh # Wipe and reinstall NvChad from scratch
After plugin manager install
- Tmux: press
Ctrl-b + Ito install TPM plugins - Vim: run
:PluginInstallinside vim
Architecture
Scripts
setup_env.sh— fresh machine only. Installs everything in order.sync.sh— day-to-day. Pulls repos and redeploys symlinks. No apt, no sudo._lib.sh— shared deploy functions sourced by both scripts.install_neovim.sh— downloads Neovim v0.11.3 to/opt/, auto-adds to.bashrc_paths. Called bysetup_env.sh.install_nvchad.sh— clones nvim config from gitea on fresh install, orgit pulls if already present. Called by bothsetup_env.shandsync.sh.reinstall_nvchad.sh— wipes all nvim data and re-runsinstall_nvchad.sh. Run manually when nvim is broken.install_*.sh— optional installs, run manually per machine.
Dotfile Management
Symlink-based deployment. Editing ~/.<file> directly edits the repo file. git status shows config drift.
deploy_configs, deploy_bin, and deploy_nvim (in _lib.sh) handle symlinking. create_symlink skips if already correct. migrate_and_link (used for gitignored files) migrates existing real files into the repo, or bootstraps from _example if nothing exists.
Tracked dotfiles (in git):
dotfiles/.bashrc— main shell configdotfiles/.vimrc,.gitconfig,.tmux.conf,.psqlrc,.pspgconfdotfiles/bin/td— time-tracking CLIdotfiles/nvim/mappings.lua— all nvim keybindingsdotfiles/nvim/td.lua,td_mappings.lua— nvim time-tracking integrationdotfiles/nvim/rename_term.lua— vault-wide find-and-replace with confirmation popup (<leader>rn)dotfiles/nvim/telescope_tasks.lua— vault-wide task pickers (<leader>tlopen tasks,<leader>tLpriority tasks)
Gitignored (machine-specific, auto-bootstrapped from examples):
dotfiles/.bashrc_local— secrets and credentialsdotfiles/.bashrc_paths— PATH additions and tool inits
Two-repo nvim setup
The nvim config lives in a separate repo at git@gitea.hptrow.me:pt/nvchad.git (customize branch), deployed to ~/.config/nvim. install_nvchad.sh manages it.
dotfiles/nvim/td.lua and td_mappings.lua are deployed as symlinks into ~/.config/nvim/lua/ by deploy_nvim. The nvim repo's mappings.lua loads them via require "td_mappings". The nvim repo does not track these files — setup_env owns them.
Dependency: deploy_nvim must run after install_nvchad.sh has created ~/.config/nvim/lua/. On a fresh machine this is handled automatically by setup_env.sh ordering. On existing machines sync.sh handles it.
Custom Bash Workflow
Database Query Management
PostgreSQL (env var $PG defined in .bashrc_local):
xnspa([args])— fzf-select an open nvim swap file, run with$PG, output CSV to VisiData. Accepts extra psql args.xnsp— same, output to pspgxns— same, raw output
SQL Server (env vars $MS, $MSC, $MSW in .bashrc_local):
xmspa()— fzf-select swap file, run with$MSC, pipe-delimited output to VisiDataxmsp— same, output to pspgxms— same, raw output
General:
ons— list open nvim swap files in current directory tree
Git Aliases
gs— git status shortga— interactive git add via fzfgx— interactive git checkout via fzfvc()—git add -u, commit with timestamp, pushgr,gc,gd,gl— reset, commit, difftool, log
Todo Grep (rg-based)
td— find unchecked todostdp/tdtp— priority todos (🔼 / ⏫)tdo/tdop— open todo in nvim at exact line
Time Tracking
Shell wrappers around dotfiles/bin/td (bypasses the td rg alias via command td):
tstart/tstop/treport/tweek
Nvim keymaps (via td_mappings.lua): <leader>ts/tp/tr/tw
Other Aliases
cj— cd to journaljr/hc— sync journal / hc notes
Machine-specific Configuration
.bashrc sources two gitignored files:
.bashrc_local— secrets: DB connection strings, passwords, tokens.bashrc_paths— PATH additions: nvim, cargo, nvm, java, etc.
Both are auto-bootstrapped from _example files on first setup_env.sh run. When a tool appends to .bashrc, git status shows it — move those lines to .bashrc_paths.
Git Commit Style
Simple lowercase messages: "add cargo", "visidata", "fix nv alias path"