From df84f1dc0e041b97dd0e219d4d804018754b1332 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 18 Mar 2026 08:43:32 +0200 Subject: [PATCH] chore(mise): update configs and add cleanup script documentation Update tooling configs, shell settings, and editor configurations as part of the mise migration. Add companion documentation for the cleanup-old-version-managers script and remove unused fish completions. --- .editorconfig-checker.json | 1 + .gitignore | 2 + CLAUDE.md | 50 +++++++++++++++++-------- biome.json | 1 + config/exports | 6 ++- config/fish/alias.fish | 3 +- config/fish/completions/kubectl.fish | 1 - config/fish/completions/orbctl.fish | 1 - config/mise/config.toml | 4 +- config/nvim/lua/utils.lua | 2 +- config/vim/vimrc | 2 +- config/zsh/p10k.zsh | 2 +- hosts/s/config/git/overrides/ignore | 1 - local/bin/dfm | 2 +- scripts/cleanup-old-version-managers.md | 20 ++++++++++ scripts/cleanup-old-version-managers.sh | 17 +++++---- scripts/install-python-packages.md | 2 +- 17 files changed, 82 insertions(+), 35 deletions(-) delete mode 120000 config/fish/completions/kubectl.fish delete mode 120000 config/fish/completions/orbctl.fish create mode 100644 scripts/cleanup-old-version-managers.md diff --git a/.editorconfig-checker.json b/.editorconfig-checker.json index 4951dce..2e929c9 100644 --- a/.editorconfig-checker.json +++ b/.editorconfig-checker.json @@ -7,6 +7,7 @@ "Exclude": [ "base/plan", "config/fish/completions/.*", + "config/karabiner/.*", "config/fish/conf.d/.*", "config/fish/functions/.*", "config/fzf/key-bindings.fish", diff --git a/.gitignore b/.gitignore index 49c8e93..0363fce 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ config/alacritty/theme-active.toml config/cheat/cheatsheets/pure-bash-bible/* config/cheat/cheatsheets/tldr/* config/fish/completions/asdf.fish +config/fish/completions/kubectl.fish +config/fish/completions/orbctl.fish config/fish/fish_variables config/fish/fish_variables.* config/gh/hosts.yml diff --git a/CLAUDE.md b/CLAUDE.md index 329157d..142637f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -172,7 +172,9 @@ Yarn (v4.12.0) is the package manager. Do not use npm. # context-mode — MANDATORY routing rules -You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session. +You have context-mode MCP tools available. These rules are NOT optional — +they protect your context window from flooding. +A single unrouted command can dump 56 KB into context and waste the entire session. ## BLOCKED commands — do NOT attempt these @@ -183,7 +185,9 @@ Instead use: - `ctx_execute(language: "javascript", code: "const r = await fetch(...)")` to run HTTP calls in sandbox ### Inline HTTP — BLOCKED -Any Bash command containing `fetch('http`, `requests.get(`, `requests.post(`, `http.get(`, or `http.request(` is intercepted and replaced with an error message. Do NOT retry with Bash. +Any Bash command containing `fetch('http`, `requests.get(`, `requests.post(`, +`http.get(`, or `http.request(` is intercepted and replaced with an error message. +Do NOT retry with Bash. Instead use: - `ctx_execute(language, code)` to run HTTP calls in sandbox — only stdout enters context @@ -202,33 +206,49 @@ For everything else, use: ### Read (for analysis) If you are reading a file to **Edit** it → Read is correct (Edit needs content in context). -If you are reading to **analyze, explore, or summarize** → use `ctx_execute_file(path, language, code)` instead. Only your printed summary enters context. The raw file content stays in the sandbox. +If you are reading to **analyze, explore, or summarize** → +use `ctx_execute_file(path, language, code)` instead. +Only your printed summary enters context. The raw file content stays in the sandbox. ### Grep (large results) -Grep results can flood context. Use `ctx_execute(language: "shell", code: "grep ...")` to run searches in sandbox. Only your printed summary enters context. +Grep results can flood context. +Use `ctx_execute(language: "shell", code: "grep ...")` to run searches in sandbox. +Only your printed summary enters context. ## Tool selection hierarchy -1. **GATHER**: `ctx_batch_execute(commands, queries)` — Primary tool. Runs all commands, auto-indexes output, returns search results. ONE call replaces 30+ individual calls. -2. **FOLLOW-UP**: `ctx_search(queries: ["q1", "q2", ...])` — Query indexed content. Pass ALL questions as array in ONE call. -3. **PROCESSING**: `ctx_execute(language, code)` | `ctx_execute_file(path, language, code)` — Sandbox execution. Only stdout enters context. -4. **WEB**: `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` — Fetch, chunk, index, query. Raw HTML never enters context. -5. **INDEX**: `ctx_index(content, source)` — Store content in FTS5 knowledge base for later search. +1. **GATHER**: `ctx_batch_execute(commands, queries)` — Primary tool. + Runs all commands, auto-indexes output, returns search results. + ONE call replaces 30+ individual calls. +2. **FOLLOW-UP**: `ctx_search(queries: ["q1", "q2", ...])` — + Query indexed content. Pass ALL questions as array in ONE call. +3. **PROCESSING**: `ctx_execute(language, code)` | + `ctx_execute_file(path, language, code)` — + Sandbox execution. Only stdout enters context. +4. **WEB**: `ctx_fetch_and_index(url, source)` then + `ctx_search(queries)` — Fetch, chunk, index, query. + Raw HTML never enters context. +5. **INDEX**: `ctx_index(content, source)` — + Store content in FTS5 knowledge base for later search. ## Subagent routing -When spawning subagents (Agent/Task tool), the routing block is automatically injected into their prompt. Bash-type subagents are upgraded to general-purpose so they have access to MCP tools. You do NOT need to manually instruct subagents about context-mode. +When spawning subagents (Agent/Task tool), the routing block is automatically +injected into their prompt. Bash-type subagents are upgraded to general-purpose +so they have access to MCP tools. +You do NOT need to manually instruct subagents about context-mode. ## Output constraints - Keep responses under 500 words. -- Write artifacts (code, configs, PRDs) to FILES — never return them as inline text. Return only: file path + 1-line description. +- Write artifacts (code, configs, PRDs) to FILES — never return them + as inline text. Return only: file path + 1-line description. - When indexing content, use descriptive source labels so others can `ctx_search(source: "label")` later. ## ctx commands -| Command | Action | -|---------|--------| -| `ctx stats` | Call the `ctx_stats` MCP tool and display the full output verbatim | -| `ctx doctor` | Call the `ctx_doctor` MCP tool, run the returned shell command, display as checklist | +| Command | Action | +|---------------|---------------------------------------------------------------------------------------| +| `ctx stats` | Call the `ctx_stats` MCP tool and display the full output verbatim | +| `ctx doctor` | Call the `ctx_doctor` MCP tool, run the returned shell command, display as checklist | | `ctx upgrade` | Call the `ctx_upgrade` MCP tool, run the returned shell command, display as checklist | diff --git a/biome.json b/biome.json index 10a030a..60e63c6 100644 --- a/biome.json +++ b/biome.json @@ -20,6 +20,7 @@ "!!**/config/op/plugins/used_plugins", "!!**/config/tmux/plugins", "!!**/config/zsh", + "!!**/config/karabiner", "!!**/config/vim", "!!**/lazy-lock.json", "!!**/local/bin/antigen.zsh", diff --git a/config/exports b/config/exports index 21865c6..0b9d5cd 100755 --- a/config/exports +++ b/config/exports @@ -18,7 +18,11 @@ [ -z "${EDITOR:-}" ] && export EDITOR="nvim" [ -z "${VISUAL:-}" ] && export VISUAL="code" -export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH" +# Bootstrap: ensure local/bin is on PATH so x-path is available +PATH="$DOTFILES/local/bin:$PATH" +# Use x-path to deduplicate PATH entries +PATH="$(x-path prepend "$XDG_BIN_HOME" "$DOTFILES/local/bin" "$XDG_DATA_HOME/cargo/bin" "/opt/homebrew/bin" "/usr/local/bin")" +export PATH if ! command -v msg &> /dev/null; then # Function to print messages if VERBOSE is enabled diff --git a/config/fish/alias.fish b/config/fish/alias.fish index 0047dc7..be5a42a 100644 --- a/config/fish/alias.fish +++ b/config/fish/alias.fish @@ -114,9 +114,10 @@ end # cd to git root directory function cdgr --description 'cd to git root' if git rev-parse --is-inside-work-tree &>/dev/null - cd (git rev-parse --show-toplevel) + cd (git rev-parse --show-toplevel); or return $status else echo >&2 "Not in a git repository" + return 1 end end diff --git a/config/fish/completions/kubectl.fish b/config/fish/completions/kubectl.fish deleted file mode 120000 index 04f9499..0000000 --- a/config/fish/completions/kubectl.fish +++ /dev/null @@ -1 +0,0 @@ -/Applications/OrbStack.app/Contents/MacOS/../Resources/completions/fish/kubectl.fish \ No newline at end of file diff --git a/config/fish/completions/orbctl.fish b/config/fish/completions/orbctl.fish deleted file mode 120000 index 19e3744..0000000 --- a/config/fish/completions/orbctl.fish +++ /dev/null @@ -1 +0,0 @@ -/Applications/OrbStack.app/Contents/MacOS/../Resources/completions/fish/orbctl.fish \ No newline at end of file diff --git a/config/mise/config.toml b/config/mise/config.toml index b35f73a..6b62f5a 100644 --- a/config/mise/config.toml +++ b/config/mise/config.toml @@ -12,7 +12,7 @@ rust = "stable" "ubi:ClementTsang/bottom" = "latest" "ubi:ajeetdsouza/zoxide" = "latest" "ubi:tree-sitter/tree-sitter" = "latest" -"ubi:neovim/neovim" = "latest" +"ubi:neovim/neovim" = "latest" # Neovim editor binary "ubi:dandavison/delta" = "latest" # Cargo-based tools (no pre-built binary available) @@ -32,7 +32,7 @@ rust = "stable" # npm-based tools "npm:editorconfig-checker" = "latest" "npm:github-release-notes" = "latest" -"npm:neovim" = "latest" +"npm:neovim" = "latest" # Node.js client for Neovim's RPC API (required by plugins) "npm:corepack" = "latest" # Python tools (via pipx backend) diff --git a/config/nvim/lua/utils.lua b/config/nvim/lua/utils.lua index 9eb65ad..3d6d8e3 100644 --- a/config/nvim/lua/utils.lua +++ b/config/nvim/lua/utils.lua @@ -102,4 +102,4 @@ function GetIntelephenseLicense() f:close() local stripped = string.gsub(content, '%s+', '') return stripped == '' and nil or stripped -end \ No newline at end of file +end diff --git a/config/vim/vimrc b/config/vim/vimrc index 6e02f6a..3cf485b 100644 --- a/config/vim/vimrc +++ b/config/vim/vimrc @@ -5,7 +5,7 @@ " vint: +ProhibitAbbreviationOption +ProhibitSetNoCompatible " mise — add shims to PATH for tool discovery -let $PATH = $HOME . '/.local/share/mise/shims:' . $PATH +let $PATH = $HOME . '/.local/bin:' . $HOME . '/.local/share/mise/shims:' . $PATH "***************************************************************************** "" Vim-Plug core "***************************************************************************** diff --git a/config/zsh/p10k.zsh b/config/zsh/p10k.zsh index 093d433..da0bfcb 100644 --- a/config/zsh/p10k.zsh +++ b/config/zsh/p10k.zsh @@ -61,7 +61,7 @@ vcs # git status # command_execution_time # previous command duration go - mise + asdf aws # =========================[ Line #2 ]========================= newline # \n diff --git a/hosts/s/config/git/overrides/ignore b/hosts/s/config/git/overrides/ignore index dda8453..86a8739 100644 --- a/hosts/s/config/git/overrides/ignore +++ b/hosts/s/config/git/overrides/ignore @@ -22,7 +22,6 @@ dfm.sh .phpactor.json .zsh_history -**/.claude/settings.local.json **/.claude/* **/.serena/* **/docs/plans/* diff --git a/local/bin/dfm b/local/bin/dfm index 5e6c1ea..f2a6813 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -169,7 +169,7 @@ section_install() if ! command -v mise &> /dev/null; then msgr nested "Installing mise..." curl https://mise.run | sh - export PATH="$HOME/.local/bin:$PATH" + export PATH="${XDG_BIN_HOME:-$HOME/.local/bin}:$PATH" fi mise install --yes mise reshim diff --git a/scripts/cleanup-old-version-managers.md b/scripts/cleanup-old-version-managers.md new file mode 100644 index 0000000..3ff7b7f --- /dev/null +++ b/scripts/cleanup-old-version-managers.md @@ -0,0 +1,20 @@ +# cleanup-old-version-managers + +Remove old version manager installations that have been replaced by mise. + +## Usage + +```bash +scripts/cleanup-old-version-managers.sh [--dry-run] +``` + +## What it does + +1. Removes data directories for nvm, fnm, pyenv, goenv, and bob-nvim. +2. Removes cargo-installed tool binaries now managed by mise. +3. Removes go-installed tool binaries from `$GOPATH/bin`. +4. Uninstalls Homebrew packages replaced by mise (if brew is available). + +Mason binaries (`$XDG_DATA_HOME/nvim/mason/`) are not touched. + +Pass `--dry-run` to preview what would be removed without making changes. diff --git a/scripts/cleanup-old-version-managers.sh b/scripts/cleanup-old-version-managers.sh index 9783a55..240e9d1 100755 --- a/scripts/cleanup-old-version-managers.sh +++ b/scripts/cleanup-old-version-managers.sh @@ -13,8 +13,8 @@ remove_dir() { local dir="$1" local label="$2" - if [ -d "$dir" ]; then - if [ "$DRY_RUN" = "--dry-run" ]; then + if [[ -d "$dir" ]]; then + if [[ "$DRY_RUN" = "--dry-run" ]]; then msgr warn "[DRY RUN] Would remove $label: $dir" else msgr run "Removing $label: $dir" @@ -30,8 +30,8 @@ remove_file() { local file="$1" local label="$2" - if [ -f "$file" ]; then - if [ "$DRY_RUN" = "--dry-run" ]; then + if [[ -f "$file" ]]; then + if [[ "$DRY_RUN" = "--dry-run" ]]; then msgr warn "[DRY RUN] Would remove $label: $file" else rm -f "$file" @@ -67,7 +67,7 @@ remove_dir "$XDG_DATA_HOME/bob" "bob-nvim data" CARGO_BIN="${XDG_DATA_HOME}/cargo/bin" CARGO_MANAGED_TOOLS=( - bkt bottom btm difft difftastic eza fd rg ripgrep + bkt btm difft eza fd rg tree-sitter tmux-sessionizer zoxide bob cargo-install-update cargo-cache ) @@ -82,7 +82,7 @@ GO_BIN="${XDG_DATA_HOME}/go/bin" GO_MANAGED_TOOLS=( yamlfmt cheat glow fzf gum sesh git-profile ) -if [ "$GO_BIN" != "$XDG_BIN_HOME" ] && [ -d "$GO_BIN" ]; then +if [[ "$GO_BIN" != "$XDG_BIN_HOME" ]] && [[ -d "$GO_BIN" ]]; then for tool in "${GO_MANAGED_TOOLS[@]}"; do remove_file "$GO_BIN/$tool" "go-installed $tool" done @@ -108,11 +108,12 @@ if command -v brew &> /dev/null; then ) for pkg in "${BREW_REMOVE[@]}"; do if brew list "$pkg" &> /dev/null; then - if [ "$DRY_RUN" = "--dry-run" ]; then + if [[ "$DRY_RUN" = "--dry-run" ]]; then msgr warn "[DRY RUN] Would brew uninstall $pkg" else msgr run "Uninstalling brew package: $pkg" - brew uninstall --ignore-dependencies "$pkg" || true + msgr warn "Note: $pkg may have dependents" + brew uninstall "$pkg" || true msgr run_done "Uninstalled $pkg" fi fi diff --git a/scripts/install-python-packages.md b/scripts/install-python-packages.md index d27e6c4..ba81a29 100644 --- a/scripts/install-python-packages.md +++ b/scripts/install-python-packages.md @@ -10,7 +10,7 @@ scripts/install-python-packages.sh ## What it does -1. Checks that `uv` is available; if missing, installs it via the official installer. +1. Checks that `uv` is available; if missing, exits with an error (install `uv` via mise first). 2. Installs each library from the inline `libraries` array using `uv pip install --system --upgrade`. To add or remove packages, edit the `libraries` array in `scripts/install-python-packages.sh`.