# setup_env Personal Linux development environment. Clone once, run one script, get a consistent shell and editor across machines. ## Fresh machine ```bash git clone git@gitea.hptrow.me:pt/setup_env.git ~/setup_env cd ~/setup_env && ./setup_env.sh ``` `setup_env.sh` handles everything in order: - Installs base packages (tmux, vim, git, fzf, ripgrep, pspg, bat) - Downloads and installs latest Neovim to `/opt/` - Clones TPM, Vundle, bash-git-prompt - Deploys all dotfile symlinks - Clones and sets up NvChad nvim config from gitea After install: - **Tmux**: press `Ctrl-b + I` to install TPM plugins - **Vim**: run `:PluginInstall` to install Vundle plugins - Edit `dotfiles/.bashrc_local` with your real credentials (auto-created from example) - Edit `dotfiles/.bashrc_paths` with PATH additions for tools on this machine (auto-created from example) ## Day-to-day sync ```bash cd ~/setup_env && ./sync.sh ``` Pulls the latest setup_env and nvim config repos, redeploys all symlinks. Safe to run anytime. ## Optional installs Run manually on machines that need them: ```bash ./install_postgres.sh # PostgreSQL from official apt repository ./install_python3.sh # Latest Python 3 from deadsnakes PPA ./install_java_dev.sh # SDKMAN for Java development ./install_visidata.sh # VisiData for terminal data exploration ``` ## Dotfile deployment All config files are symlinked, not copied — editing `~/.` edits the repo file directly. `git status` always shows config drift. | Source | Deployed to | Notes | |---|---|---| | `dotfiles/.bashrc` | `~/.bashrc` | Main shell config | | `dotfiles/.bashrc_local` | `~/.bashrc_local` | Secrets/credentials — gitignored | | `dotfiles/.bashrc_paths` | `~/.bashrc_paths` | PATH and tool inits — gitignored | | `dotfiles/.vimrc`, `.gitconfig`, `.tmux.conf`, etc. | `~/` | Standard dotfiles | | `dotfiles/bin/*` | `~/.local/bin/` | Executable scripts | | `dotfiles/nvim/*.lua` | `~/.config/nvim/lua/` | Nvim lua modules | When a tool appends lines to `.bashrc`, `git status` shows the modification — move those lines to `.bashrc_paths` instead. ## Machine-specific config Two gitignored files sourced by `.bashrc`, auto-bootstrapped from examples on first run: - **`.bashrc_local`** — DB connection strings, passwords, tokens - **`.bashrc_paths`** — PATH additions (nvim, cargo, nvm, java, etc.) --- ## td — markdown todo time tracking Track time on markdown todos identified by a block-ref `^tid-*`. Data lives in `time.csv` at the vault root. ### Surfaces | Surface | Location | How to use | |---|---|---| | CLI | `bin/td` → `~/.local/bin/td` | `command td ` | | Shell wrappers | `.bashrc` | `tstart`, `tstop`, `treport`, `tweek` | | Nvim | `nvim/td.lua` + `nvim/td_mappings.lua` | `ts/tp/tr/tw` or `:TdStart/Stop/Report/Week` | ### Subcommands | Command | What it does | |---|---| | `td start [--file PATH] [--desc TEXT]` | Start timer, auto-stops any running entry | | `td stop` | Close the open entry | | `td report [filter]` | Total time per tid (filter matches tid or file) | | `td week [--since DATE]` | Tasks from git log joined with time data | | `td current` | Print the currently-running tid | | `td tidgen` | Generate a fresh tid | ### How `td week` works Scans `git log -p` from cwd, pairs `-`/`+` task-line diffs within each commit by tid: - `[x]` **done** — `- [ ]` → `- [x]` transition - `[ ]` **new** — added `- [ ]` line with a fresh tid - `[+]` **done+new** — created and completed in the same commit - `[o]` **reopen** — `- [x]` → `- [ ]` transition ### Nvim integration `ts` on a `- [ ]` line auto-generates a `^tid-*` block ref if missing, saves the buffer, and starts the timer. `tp` stops, `tr` shows a report float, `tw` shows the week float. Close floats with `q` or ``. ### Gotchas - **`td` alone is aliased to `rg`** for todo-grepping. Use `tweek`, `treport` etc. or `command td` to reach the CLI directly. - **CSV is cwd-scoped.** Run subcommands from the vault root. The nvim wrapper walks up to find it; shell wrappers trust your cwd. - **Data-model changes go in `bin/td`.** Shell and nvim surfaces stay thin wrappers.