Skip to content
maxrossignolPublic

About

I use VIM by the way

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Dotfiles

Here are my dotfiles, I will be adding to it and explaining along the way.

A journey begins.

Setup/

One-shot (fresh Mac)

Paste this in Terminal — it installs Homebrew + git, clones the repo (HTTPS), and runs make setup:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \
  && eval "$(/opt/homebrew/bin/brew shellenv 2>/dev/null || /usr/local/bin/brew shellenv)" \
  && brew install git \
  && git clone https://github.com/maxmaxou2/dotfiles.git ~/dotfiles \
  && cd ~/dotfiles \
  && make setup

Breakdown (idempotent, re-running is safe)

From inside the cloned repo (~/dotfiles):

make setup

This runs make xcode-clt, make brew, make stow, make jaynalerts, make context-mode, make agentmemory, make litellm, make pi, make codex, make tmux-plugins, make verify-symlinks (see Makefile for all targets).

The repo does not have to live at ~/dotfiles — make stow passes --dir=$(CURDIR) --target=$(HOME), so any clone location works.

HomeBrew

make brew        # symlinks .Brewfile into $HOME, then `brew bundle --global`

Symlinks

make stow        # stow --restow --dir=<repo> --target=$HOME <STOW_PACKAGES>

STOW_PACKAGES is defined at the top of the Makefile; edit it there rather than keeping a second list in this README.

jaynalerts (notifications for Claude Code & opencode)

make jaynalerts

Clones git@github.com:jaynlabs/jaynalerts.git into ~/src/jaynalerts. It is a private repo, so this step needs an SSH key already registered with GitHub and access to the jaynlabs org — it is the one part of make setup that cannot run on a bare machine. Override the source with make jaynalerts JAYNALERTS_REPO=....

make setup in jaynalerts does bun link (puts jaynalerts on PATH) and jaynalerts init --claude-code --opencode --shell-rc ~/.zshrc, which installs the Claude Code hooks, the opencode plugin, compiles the Swift notifier, and writes its managed block into ~/.zshrc — i.e. into zsh/.zshrc here, since that path is stowed. make jaynalerts depends on stow so the symlink exists first.

Replaces the older stay-alert. jaynalerts notifies through its own Swift UNUserNotification helper and is focus-aware on its own (transient when the terminal is focused, sticky when it is not), so the Hammerspoon hook that used to clear alerter notifications on Ghostty focus — and the alerter dependency itself — are gone.

pi (coding agent)

make pi                # npm install -g @earendil-works/pi-coding-agent, then check the stowed config
make verify-symlinks

pi reads everything from ~/.pi/agent/, which mixes config with machine-local state, so the pi stow package owns only two paths:

  • pi/.pi/agent/settings.json — provider/model defaults, theme, steering mode. pi rewrites this file in place (e.g. lastChangelogVersion after an upgrade), and since it is a symlink those writes land in this repo. That is intentional.
  • pi/.pi/agent/extensions/jaynalerts.ts — the notification extension, written by jaynalerts init --pi through the symlink. Same managed-file deal as the jaynalerts block in zsh/.zshrc.

Everything else in ~/.pi/agent stays machine-local and is kept out both by pi/.stow-local-ignore and by the root .gitignore: auth.json (credentials), models-store.json (~110KB provider cache), sessions/, and a vendored fd binary under bin/.

Skills are not duplicated per agent: pi and Codex both read ~/.agents/skills, which is populated with symlinks into claude/.claude/skills — one copy serves Claude Code, Codex and pi.

Codex CLI

make codex             # npm install -g @openai/codex, then check the stowed config
make verify-symlinks

Like pi, ~/.codex mixes config with a lot of runtime state, so the codex package stows only the declarative half:

  • codex/.codex/config.toml — model, reasoning effort, TUI/status line, MCP servers, plugins and marketplaces. Expect churn: Codex appends a [projects."<path>"] trust_level block every time you trust a new directory, and rewrites [hooks.state] trusted_hash values and [marketplaces] revisions on its own. Those are machine-local by nature but live in the same file as the real config, so they ride along in the diffs.
  • codex/.codex/hooks.json — the code-review-graph PostToolUse/SessionStart hooks and the jaynalerts PermissionRequest hook.
  • codex/.codex/rules/default.rules — the command allowlist. Codex appends a prefix_rule(...) here each time you approve a command, so this file grows through the symlink into this repo.

Everything else stays machine-local and is excluded by codex/.stow-local-ignore plus the root .gitignore: auth.json, the sqlite databases (thread_history_1, logs_2, state_5, queue_1, memories_1, goals_1), sessions/, history.jsonl, plugins/ cache, shell_snapshots/ and context-mode/.

~/.codex/agents and ~/.codex/rules are folded by stow into directory symlinks, so anything Codex writes there is version controlled automatically.

context-mode (token-saving routing for opencode)

make context-mode      # npm install -g context-mode
make verify-symlinks   # sanity-check ~/.claude/* and opencode.json symlinks
  • opencode: registered via plugin: ["context-mode"] in opencode/.config/opencode/opencode.json. Plugin is loaded in-process — no MCP entry needed. Routing rules live in opencode/.config/opencode/AGENTS.md.
  • Claude Code and Codex: not installed. The plugin, its marketplace, and the context-mode-cache-heal.mjs SessionStart hook were removed from claude/.claude/settings.json and ~/.codex/config.toml.

agentmemory (persistent cross-session memory for Claude Code & opencode)

make agentmemory       # npm install -g @agentmemory/agentmemory, launchd autostart, claude plugin
make verify-symlinks

Persistent memory that auto-captures sessions/tools and recalls context into future sessions. A local REST server runs on http://localhost:3111 (viewer: http://localhost:3113).

  • Server: make agentmemory installs the @agentmemory/agentmemory npm package and renders agentmemory/ai.agentmemory.plist.in into ~/Library/LaunchAgents/ai.agentmemory.plist so the server autostarts at login (KeepAlive). launchd plists take no variable expansion, so the template's @HOME@ / @PATH@ / @AGENTMEMORY_BIN@ are substituted at install time — nothing user-specific is committed.
  • Provider keys: on a fresh machine agentmemory init seeds ~/.agentmemory/.env. Fill in the LLM + embeddings keys there — this file holds secrets and is not committed. Verify with agentmemory status (Provider/Embeddings should be ✓).
  • Claude Code: marketplace rohitg00/agentmemory is declared under extraKnownMarketplaces and enabled via enabledPlugins["agentmemory@agentmemory"] in claude/.claude/settings.json. The plugin registers 12 hooks, 8 skills, and auto-wires the @agentmemory/mcp server via its own .mcp.json — no manual mcpServers entry needed. make agentmemory runs claude plugin marketplace add rohitg00/agentmemory && claude plugin install agentmemory@agentmemory; if the CLI step fails, run /plugin install agentmemory inside Claude Code.
  • opencode: wired declaratively in opencode/.config/opencode/opencode.json — manual mcp.agentmemory entry (opencode does NOT auto-wire MCP) plus plugin: ["./plugins/agentmemory-capture.ts"]. The plugin (plugins/agentmemory-capture.ts, 22 auto-capture hooks) and /recall+/remember commands (commands/) are stowed by the opencode package via make stow.
  • Verify: curl http://localhost:3111/agentmemory/health and agentmemory status.
  • MCP shim: set AGENTMEMORY_URL=http://localhost:3111 and AGENTMEMORY_FORCE_PROXY=1 in ~/.agentmemory/.env so the MCP server (Claude Code memory_* tools, opencode /recall) always proxies to the daemon instead of silently falling back to a throwaway standalone db when the daemon was briefly down at shim start.
  • LLM compression (optional, richer summaries) is routed through a LiteLLM proxy → Vertex/Gemini — see next section.

LiteLLM → Vertex AI (Gemini) for agentmemory compression

make litellm

agentmemory's AGENTMEMORY_AUTO_COMPRESS runs an LLM on observations for richer memories. agentmemory has no native Vertex support (its Gemini path only hits AI Studio), so a local LiteLLM proxy bridges it: agentmemory speaks OpenAI → LiteLLM → Vertex AI (Gemini 2.5 Flash) using a GCP service account, billed to the jayn-dev project / europe-west4.

agentmemory ──OpenAI API──▶ LiteLLM (localhost:4000) ──SA auth──▶ Vertex AI / Gemini 2.5 Flash
  • Install/run: make litellm installs the proxy via uv (with google-cloud-aiplatform + google-auth) and renders litellm/ai.litellm.plist.in into ~/Library/LaunchAgents/ai.litellm.plist (autostart, KeepAlive).
  • Config: litellm/.config/litellm/config.yaml is committed and stowed to ~/.config/litellm/config.yaml. It holds no secrets and no absolute paths — every machine-specific value (master_key, vertex_project, vertex_credentials, database_url) is an os.environ/X lookup the proxy resolves at startup from ~/.config/litellm/.env, which the launchd job sources before exec. That .env is rendered from litellm/.config/litellm/.env.example on make litellm and is gitignored (so is *-sa.json).
  • Secrets (manual on a fresh machine, never committed):
    1. Place the Vertex service-account JSON at ~/.config/litellm/vertex-sa.json (chmod 600).
    2. Fill LITELLM_MASTER_KEY, GITHUB_TOKEN, OPENCODE_API_KEY and VERTEX_PROJECT in ~/.config/litellm/.env. make litellm warns for each one left empty.
    3. Point agentmemory at it in ~/.agentmemory/.env:
      OPENAI_API_KEY=<the litellm master_key>
      OPENAI_BASE_URL=http://localhost:4000
      OPENAI_MODEL=gemini-flash
      EMBEDDING_PROVIDER=openai          # route embeddings through litellm too
      OPENAI_EMBEDDING_MODEL=vertex-embed
      OPENAI_EMBEDDING_DIMENSIONS=768
      AGENTMEMORY_AUTO_COMPRESS=true
      MAX_TOKENS=1024
      
    4. Restart: launchctl kickstart -k gui/$(id -u)/ai.agentmemory.
    5. For the opencode→LiteLLM provider (the architect-gemini agent), export the same master_key in ~/.zshrc_private (gitignored, sourced by zsh/.zshrc):
      export LITELLM_MASTER_KEY=<the litellm master_key>
      
      opencode resolves {env:LITELLM_MASTER_KEY} at launch; without it the provider sends an empty bearer and Vertex calls 401. make litellm warns if it's unset.
  • opencode provider: opencode/.config/opencode/opencode.json declares a litellm provider (@ai-sdk/openai-compatible → localhost:4000/v1) so any opencode agent can target a LiteLLM model via litellm/<model_name>. The architect-gemini agent (agents/architect-gemini.md) uses litellm/gemini-3-pro → Vertex gemini-3.1-pro-preview (global endpoint). Add a model = one model_list entry in config.yaml + one line under the provider's models.
  • Why these choices: reasoning_effort: disable (Gemini 2.5 thinking wastes output tokens on compression); both LLM (gemini-2.5-flash) and embeddings (gemini-embedding-2, top MTEB, 768-dim) run on Vertex credits.
  • Embedding-2 quirk: it's global-endpoint only (vertex_location: global) — 404s on a regional location like europe-west4.
  • Switching embedding provider/dims after data exists crashes the worker (persisted vector index has wrong dimension). Recovery: add AGENTMEMORY_DROP_STALE_INDEX=true to ~/.agentmemory/.env, restart, then remove the line (rebuilds from live observations).
  • Verify: curl http://localhost:4000/health/liveliness → 200; live test: KEY=$(grep '^LITELLM_MASTER_KEY=' ~/.config/litellm/.env | cut -d= -f2-); curl -s localhost:4000/v1/chat/completions -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"model":"gemini-flash","messages":[{"role":"user","content":"ping"}],"max_tokens":50}'

Backups (restic → Hetzner Storage Box)

make backup              # restic, launcher, ~/.config/restic skeleton, hourly launchd job
restic-backup init       # once per machine, creates the encrypted repository
caffeinate -i restic-backup   # first full upload, keeps the Mac awake

backup/restic-backup.sh backs up $HOME every hour and, once a week, prunes old snapshots and downloads 5% of the repository to verify it. Snapshots are kept hourly for 2 days, daily for 2 weeks, weekly for 2 months and monthly for a year, counted from the latest snapshot so a Mac that sits closed for weeks keeps its history. What is skipped is in backup/excludes.txt: ~/Library, toolchains, package caches, node_modules/.venv, anything tagged CACHEDIR.TAG, and logs.

  • Nothing secret is committed. ~/.config/restic/ (mode 700) holds env (repository, fixed host name, healthchecks URLs; template in backup/env.example), password (generated by make backup) and excludes.local (personal paths). The storage box login is a Host storagebox-backup block in ~/.ssh/config with its own key, ~/.ssh/id_ed25519_storagebox.
  • The repository password is the one thing that must outlive the Mac. Keep a copy in a password manager; without it the backup cannot be decrypted.
  • Full Disk Access goes to ~/.local/bin/restic-backup-launcher, a small C program that launchd starts instead of the script. macOS charges a launchd job's file reads to the job's own binary, so the grant lives on the launcher and survives restic upgrades. Without it the job cannot read Desktop, Documents or Downloads.
  • Alerts come from healthchecks.io by email: no successful backup for 3 days, or no successful maintenance for 9. A failed run is only logged there, since a laptop is often offline. restic's exit code 3 (some files unreadable, typically a lost Full Disk Access grant) counts as a failure.
  • Runs never overlap. A run that starts while another is still going (the first full upload, a manual run) exits straight away and leaves the next hour to catch up.
  • Logs: ~/.local/state/restic-backup/ (backup.log, maintain.log, history.log).

Restore:

restic-backup snapshots
restic-backup restore latest --target /tmp/restore --include "$HOME/src/some-repo"
restic-backup mount /tmp/restic        # browse every snapshot (needs macFUSE)

Adding a Mac (each machine gets its own Storage Box sub-account, repository and password):

  1. Storage Box owner, Hetzner Console: create a sub-account with its own folder, SSH support and external reachability on, not read-only.
  2. New Mac: FileVault on, then make backup from a clone of this repo (not make setup). The clone must stay where it is: the launchd job runs the script from it.
  3. Grant Full Disk Access to ~/.local/bin/restic-backup-launcher; save ~/.config/restic/password in a password manager.
  4. ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519_storagebox, and add to ~/.ssh/config:
    Host storagebox-backup
      HostName uXXXXXX-subN.your-storagebox.de
      User uXXXXXX-subN
      Port 23
      IdentityFile ~/.ssh/id_ed25519_storagebox
      IdentitiesOnly yes
      ServerAliveInterval 60
      ServerAliveCountMax 240
    
  5. Install the key: cat ~/.ssh/id_ed25519_storagebox.pub | ssh storagebox-backup install-ssh-key (asks for the sub-account password). Only accept the host key if its fingerprint is one Hetzner publishes; for ED25519 that is SHA256:XqONwb1S0zuj5A1CDxpOSuD2hnAArV1A3wKY7Z3sdgM.
  6. Fill ~/.config/restic/env: RESTIC_HOST and two healthchecks.io checks (backup: period 1 day, grace 2 days; maintenance: period 7 days, grace 2 days).
  7. restic-backup init, then preview what would be uploaded and add personal paths to skip to ~/.config/restic/excludes.local:
    restic-backup backup "$HOME" --dry-run -vv --one-file-system --exclude-caches \
      --exclude-file backup/excludes.txt --exclude-file ~/.config/restic/excludes.local
    
  8. make backup again to schedule the hourly job, then caffeinate -i restic-backup for the first full upload (mains power, lid open).

Machine-local settings (not in this repo)

Two files hold per-machine state and are deliberately not committed:

  • ~/.zshrc_private — secrets, work aliases, tokens. Sourced by zsh/.zshrc if present.
  • ~/.claude/settings.local.json — Claude Code user settings that are machine- or employer-specific, notably the autoMode block (trusted repo, org, prod-command deny list). It is a real file, not stowed, and is globally gitignored. The committed claude/.claude/settings.json holds only portable settings.

Additional steps

  • Karabiner :

    • Open Karabiner-Elements from your Applications folder.
    • Grant necessary permissions in System Preferences > Security & Privacy (Input Monitoring and Accessibility).
  • Postgres related :

createuser --superuser $USER -U postgres
createdb $USER -U $USER

Todo List/

  • Add scripts calling general commands for setup

Neovim Configuration

My Neovim setup is designed for a modern development experience with a focus on productivity and ergonomics. Here's a breakdown of the key plugins and their purposes:

Core Plugins

  • LazyVim - Plugin manager and configuration framework
  • Catppuccin - A soothing pastel theme for Neovim
  • Telescope - Fuzzy finder for files, buffers, and more
    • With telescope-fzf-native for better performance
  • Treesitter - Advanced syntax highlighting and code navigation
    • With nvim-treesitter-context for showing code context
    • With playground for debugging syntax highlighting
    • With nvim-treesitter-textobjects for smart text objects

LSP and Completion

  • Mason - Package manager for LSP servers
  • mason-lspconfig - Auto enabling of mason lsp servers
  • blink-cmp - Completion engine with blink effect
  • nvim-lspconfig - Native LSP configuration
  • conform - Formatter plugin, lightweight yet powerful

Navigation and Editing

  • Harpoon2 - Quick file navigation between frequently used files
  • Leap - Quick motion plugin for faster navigation
  • nvim-surround - Easy text surrounding operations
  • nvim-autopairs - Automatic bracket pairing
  • nvim-ufo - Modern folding experience
  • vim-tmux-navigator - Seamless navigation between Vim and tmux splits

Development Tools

  • vim-test - Testing support
  • avante.nvim - AI-powered coding assistant

Quality of Life

  • bigfile - Better handling of large files
  • yeet - Quick file operations
  • persistence - Session management
  • vim-be-good - Neovim training game
  • cellular-automaton - Fun animations

Special Features

  • Azerty Layout Support - Custom configuration for AZERTY keyboard layout
  • Custom Keymaps - Personalized key mappings for improved workflow

This configuration is continuously evolving as I discover new tools and better ways to work with Neovim. Feel free to explore and adapt any parts that you find useful!

Hammerspoon Configuration/

My Hammerspoon setup includes several productivity-enhancing features:

Key Logger

  • Displays active key presses in real-time
  • Toggle with ctrl + cmd + k
  • Useful for presentations and debugging keyboard inputs
  • Cycles through predefined positions before disabling

Application Quick Launch

  • Fast application switching using keyboard shortcuts
  • Mapped to ctrl + cmd + [number]
  • Common applications mapped to numbers (7,8,9, etc.)
  • Provides instant access to frequently used applications
  • Application window maximization (fake fullscreen) using ctrl + cmd + F

Multi-Display Management

  • Move the focused window to the next display (maximized) with ctrl + cmd + m

This setup provides quick access to applications and keyboard input visualization when needed.

Keymap Cheatsheet

Neovim Keymaps

General

  • <Space> - Leader key
  • <leader>e - Open file explorer (Ex)
  • <C-s> - Save file (works in normal, insert, and visual modes)

Window Management

  • <C-Up/Down/Left/Right> - Resize windows
  • <C-w>q or <C-w><C-q> - Close split and navigate left (Tmux aware)
  • <leader>gd - Open definition in vertical split
  • <leader>gg - Open references in vertical split
  • <leader>gr - Open LSP references in vertical split

Clipboard Operations

  • <leader>y - Copy to system clipboard
  • <leader>Y - Copy line to system clipboard (from cursor to end)
  • <leader>yy - Copy whole line to system clipboard
  • <leader>p - Paste from system clipboard
  • <leader>P - Paste before from system clipboard
  • <leader>yp - Copy full file path to clipboard
  • <leader>yn - Copy filename to clipboard
  • <leader>yd - Copy parent directory path to clipboard

Navigation

  • <C-d> - Scroll down (centered)
  • <C-u> - Scroll up (centered)
  • <C-j> - Go down a pane (Tmux aware)
  • <C-k> - Go up a pane (Tmux aware)
  • <C-h> - Go left a pane (Tmux aware)
  • <C-l> - Go right a pane (Tmux aware)

Indentation

  • <S-Tab> - Unindent (normal and insert mode)
  • <Tab> - Indent (visual mode)
  • <S-Tab> - Unindent (visual mode)

Development

  • <leader>bp - Insert Python breakpoint
  • <leader>bd - Insert Dagster debugger breakpoint
  • <leader>T - Launch nearest test, test file or test class
  • <leader>S - Launch nearest test, test file or test class while updating snapshots

Telescope (Fuzzy Finder)

  • <C-p> - Find files (git files if in repo, all files otherwise)
  • <leader>ps - Grep with input prompt
  • <leader>pf - Live grep
  • <leader>w - Fuzzy find in current buffer
  • gr - Find LSP references
  • gd - Go to LSP definition
  • <leader>gr - Go to LSP references in a new v-split
  • <leader>gd - Go to LSP definition in a new v-split

Diffview

  • <leader>dv - Opens up telescope git branches listing and show diffview for the selected, quit diffview if already opened
  • <leader>df - Toggles file tree display

Hammerspoon Keymaps

Window Management

  • ctrl + cmd + F - Make focused window fullscreen (custom fullscreen)

Application Management

  • ctrl + cmd + k - Toggle key logger display
  • ctrl + cmd + m - Screen swapping functionality

Note: Additional Hammerspoon keybindings for application quick launch (ctrl + cmd + [number]) are configured but not explicitly listed in the configuration files.

This cheatsheet will be continuously updated as new keymaps are added to my configuration.

About

I use VIM by the way

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages