diff --git a/.chezmoiroot b/.chezmoiroot
new file mode 100644
index 0000000..5e72f75
--- /dev/null
+++ b/.chezmoiroot
@@ -0,0 +1 @@
+home
diff --git a/.chezmoiversion b/.chezmoiversion
new file mode 100644
index 0000000..9e0b850
--- /dev/null
+++ b/.chezmoiversion
@@ -0,0 +1 @@
+2.72.0
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..2a8000f
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,18 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.{fish,sh,bash,yml,yaml,json,toml,md}]
+indent_style = space
+indent_size = 2
+
+[*.lua]
+indent_style = tab
+tab_width = 2
+
+[Makefile]
+indent_style = tab
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..100ad82
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,8 @@
+* text=auto
+
+*.fish text eol=lf
+*.lua text eol=lf
+*.sh text eol=lf
+*.toml text eol=lf
+*.yml text eol=lf
+*.reg text eol=crlf
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..dce1c8a
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,8 @@
+version: 2
+
+updates:
+ - package-ecosystem: github-actions
+ directory: /
+ schedule:
+ interval: monthly
+ open-pull-requests-limit: 2
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
new file mode 100644
index 0000000..b91ce29
--- /dev/null
+++ b/.github/workflows/check.yml
@@ -0,0 +1,105 @@
+name: check
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ workflow_dispatch:
+
+concurrency:
+ group: check-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ static:
+ name: static (${{ matrix.os }})
+ runs-on: ${{ matrix.os }}
+ # Dependency installation shares this job, so keep infrastructure failures
+ # separate from the tighter timeout on the repository check itself.
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ os:
+ - ubuntu-latest
+ - macos-latest
+
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Install Linux checks
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get update
+ sudo apt-get install --yes \
+ build-essential fish i3-wm jq lua5.4 luarocks nodejs npm \
+ ripgrep shellcheck tmux unzip xz-utils
+
+ - name: Install macOS checks
+ if: runner.os == 'macOS'
+ run: brew install fish jq lua luarocks node ripgrep shellcheck tmux
+
+ - name: Install pinned Neovim
+ shell: bash
+ run: |
+ set -euo pipefail
+ nvim_version=0.12.4
+ case "$(uname -s)/$(uname -m)" in
+ Darwin/arm64)
+ nvim_asset=nvim-macos-arm64.tar.gz
+ nvim_sha256=51ab83afa66d663627c2ab1be43209b0f4e81360d4598b53efaa4d8195f24c89
+ ;;
+ Darwin/x86_64)
+ nvim_asset=nvim-macos-x86_64.tar.gz
+ nvim_sha256=03fe16f8dd9f1e9eaf52d5e294913a39917b9e2faea30d7fb0fb385fbd36fe59
+ ;;
+ Linux/aarch64 | Linux/arm64)
+ nvim_asset=nvim-linux-arm64.tar.gz
+ nvim_sha256=ceb7e88c6b681f0515d135dcdfad54f5eb4373b25ce6172197cd9a69c758063f
+ ;;
+ Linux/x86_64)
+ nvim_asset=nvim-linux-x86_64.tar.gz
+ nvim_sha256=012bf3fcac5ade43914df3f174668bf64d05e049a4f032a388c027b1ebd78628
+ ;;
+ *)
+ printf 'unsupported Neovim CI platform\n' >&2
+ exit 1
+ ;;
+ esac
+ nvim_archive="$RUNNER_TEMP/$nvim_asset"
+ curl --fail --location --silent --show-error \
+ --proto '=https' --tlsv1.2 \
+ --connect-timeout 15 --max-time 300 \
+ --retry 3 --retry-delay 2 --retry-connrefused \
+ --output "$nvim_archive" \
+ "https://github.com/neovim/neovim/releases/download/v${nvim_version}/${nvim_asset}"
+ if command -v sha256sum >/dev/null 2>&1; then
+ nvim_actual=$(sha256sum "$nvim_archive" | awk '{print $1}')
+ else
+ nvim_actual=$(shasum -a 256 "$nvim_archive" | awk '{print $1}')
+ fi
+ [[ $nvim_actual == "$nvim_sha256" ]]
+ tar -xzf "$nvim_archive" -C "$RUNNER_TEMP"
+ nvim_root=${nvim_asset%.tar.gz}
+ printf '%s\n' "$RUNNER_TEMP/$nvim_root/bin" >> "$GITHUB_PATH"
+
+ - name: Install repository-pinned chezmoi
+ shell: bash
+ run: |
+ chezmoi_bin_dir="$RUNNER_TEMP/dotfiles-bin"
+ ./scripts/install-chezmoi --force --bin-dir "$chezmoi_bin_dir"
+ printf '%s\n' "$chezmoi_bin_dir" >> "$GITHUB_PATH"
+
+ - name: Run checks
+ timeout-minutes: ${{ github.event_name == 'pull_request' && 5 || 20 }}
+ env:
+ # Pull requests stay fast. The reviewed main state and manual runs
+ # exercise network provisioning; Linux also runs the full cold graph.
+ DOTFILES_CHECK_NETWORK: ${{ github.event_name != 'pull_request' && '1' || '0' }}
+ DOTFILES_CHECK_NVIM_FULL: ${{ runner.os == 'Linux' && github.event_name != 'pull_request' && '1' || '0' }}
+ DOTFILES_CHECK_STRICT: '1'
+ run: ./scripts/check
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6c91d50
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+# Operating-system and editor state
+.DS_Store
+Thumbs.db
+*.swp
+*.swo
+*~
+
+# Fish universal variables are mutable, machine-local state.
+home/dot_config/fish/fish_variables
+home/dot_config/fish/fish_variables.*
+
+# Application caches and generated runtime data must not enter the source tree.
+home/dot_config/nvim/.luarc.json
+home/dot_config/tmux/plugins/
diff --git a/README.md b/README.md
index 0a5ca50..d195f93 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,410 @@
-# dotfiles
+
+
+
-“工欲善其事,必先利其器。”
+# m1ngsama's dotfiles
-> Dotfile of the tools what I use.
+> 工欲善其事,必先利其器。
-## Including
+A keyboard-first Solarized Osaka setup for Neovim, tmux, Fish, Alacritty,
+and a minimal i3/X11 rice. This repository stores reviewed desired state—not a
+snapshot of one machine.
-- [fish](https://github.com/fish-shell/fish-shell)
+> [!WARNING]
+> These are personal workstation defaults. Do not apply them blindly.
+> Bootstrap previews first and writes only with `--apply`; review the diff and
+> keep its backup until the new setup has survived a full login.
-- [neovim](https://github.com/neovim/neovim)
+## What's inside
-- [tmux](https://github.com/tmux/tmux)
+| Area | Stack | Character |
+| --- | --- | --- |
+| Editor | Neovim 0.12, LazyVim, Mason, Tree-sitter | Exact 50-plugin lock, LSP and formatting |
+| Shell | Fish, nvm.fish, optional eza/zoxide/ghq/fzf | Fast startup with guarded integrations |
+| Multiplexer | tmux | `Ctrl-T` prefix, vi navigation, guarded lazygit popup |
+| Terminal | Alacritty, ranger | True color, portable previews |
+| Desktop | i3, Picom, rofi | Small X11 rice, 2 px focus borders, optional wallpaper |
+| Management | chezmoi and repository scripts | Preview, backup, rollback, restore, verification |
-- Customed Keymaps Files
+The palette is locked to
+[Solarized Osaka](https://github.com/craftzdog/solarized-osaka.nvim), with
+restrained background transparency and explicit non-color error markers.
+JetBrainsMono Nerd Font Mono is preferred; DejaVu Sans Mono and `monospace`
+remain usable fallbacks.
+## Support
+
+| Profile | Status | Managed scope |
+| --- | --- | --- |
+| Linux core | Tier 1 | Fish, Neovim, tmux, Alacritty, ranger |
+| macOS core | Tier 1 | Fish, Neovim, tmux, Alacritty, ranger |
+| Linux X11 | Tier 1 | i3, Picom, Xresources, Xmodmap, X startup |
+| Windows | Auxiliary | Caps-to-Control registry file, manual only |
+| Wayland | Planned | A future, separate Sway profile |
+
+Current minimums are Fish 3.6+, Neovim 0.12.0+, tmux 3.2+, chezmoi 2.72.0+,
+and i3 4.22+ for X11. The source state targets `$HOME/.config`; a non-default
+`$XDG_CONFIG_HOME` is not yet part of the support contract.
+
+### Ranger preview tools
+
+Ranger keeps a small `rc.conf` and a tracked preview script. Core navigation
+needs only `ranger` and `file`; the optional media paths are guarded and enable
+themselves when their commands are installed:
+
+| Capability | Optional commands |
+| --- | --- |
+| Images and font previews | `chafa`, ImageMagick, `fontimage`, `exiftool` |
+| Video thumbnails and metadata | `ffmpegthumbnailer`, `mediainfo` |
+| PDF image/text previews | Poppler (`pdftoppm`, `pdftotext`) or MuPDF |
+| Source and structured text | `bat`, `highlight`, Pygments, `jq` |
+| Archives | `atool`, `bsdtar`, `unrar`, `7z` |
+| Recoverable deletion bindings | `trash-put`, `trash-restore` from trash-cli |
+
+Package names vary by operating system. The managed default keeps ranger's
+graphical image mode disabled and uses `chafa` for portable terminal previews.
+Set `preview_images` and `preview_images_method` locally only after selecting a
+renderer supported by the active terminal.
+
+## Install
+
+### 1. Clone
+
+```sh
+git clone https://github.com/m1ngsama/dotfiles.git
+cd dotfiles
+```
+
+### 2. Install the pinned chezmoi
+
+Use an existing chezmoi 2.72.0+, or install the repository-pinned binary
+without executing a remote shell:
+
+```sh
+./scripts/install-chezmoi
+```
+
+The installer supports macOS/Linux on amd64/arm64, verifies a static SHA-256,
+and refuses to replace another binary unless `--force` is explicit. Pass the
+verified path directly so another executable cannot shadow it:
+
+```sh
+./scripts/bootstrap --chezmoi "$HOME/.local/bin/chezmoi"
+```
+
+That command initializes the local chezmoi config and shows the target diff.
+It does not write a managed dotfile.
+
+### 3. Review, then apply
+
+```sh
+./scripts/bootstrap --chezmoi "$HOME/.local/bin/chezmoi" --apply
+```
+
+Existing targets prompt before replacement. For automation, force is a
+separate authorization accepted only together with `--apply`:
+
+```sh
+./scripts/bootstrap --non-interactive --no-linux-x11 --apply --force
+```
+
+Linux prompts for the X11 profile. It can also be selected explicitly:
+
+```sh
+./scripts/bootstrap --linux-x11
+./scripts/bootstrap --no-linux-x11
+```
+
+The first choice is persisted. On an existing chezmoi config, these flags
+affect only the current run so local age, diff, edit, and data settings remain
+byte-for-byte intact. Edit `data.profiles.linuxX11` in that config to make a
+later change persistent.
+
+Windows receives no chezmoi-managed target. Review and back up the affected
+registry key before manually importing `keymap/capstoctrl.reg`.
+
+### What bootstrap protects
+
+- Every apply first backs up existing files, symlinks, and directory modes to
+ `${XDG_STATE_HOME:-$HOME/.local/state}/dotfiles/backups`.
+- Apply, verification, optional legacy cleanup, and signal handling form one
+ transaction; failures restore that run automatically.
+- A chezmoi config pointing to another repository is refused, not overwritten.
+- Destination and backup paths reject unsafe symlink parent chains.
+- No source directory is `exact_`, so unrelated local extensions and runtime
+ state are not deleted.
+
+## Daily workflow
+
+The generated chezmoi config remembers this checkout as its source:
+
+```sh
+chezmoi diff
+chezmoi apply --dry-run --verbose
+./scripts/bootstrap --apply
+chezmoi verify
+```
+
+Use bootstrap for writes when you want the repository's pre-apply backup.
+Avoid `init --apply` on an existing home directory: a first-time target is not
+protected by chezmoi's later conflict history.
+
+### Keymap highlights
+
+| Context | Keys | Action |
+| --- | --- | --- |
+| Fish | `Ctrl-G` | Pick a ghq repository with fzf, when both are installed |
+| tmux | `Ctrl-T r` | Reload this tmux configuration |
+| tmux | `Ctrl-T h/j/k/l` | Move between panes |
+| tmux | `Ctrl-T \|` / `Ctrl-T -` | Split horizontally / vertically |
+| tmux | `Ctrl-T g` | Open lazygit in a popup, when installed |
+| Neovim | `ss` / `sv` | Split horizontally / vertically |
+| Neovim | `sh/sj/sk/sl` | Move between windows |
+| Neovim | `Space mp` | Toggle the in-editor Markdown preview |
+| Neovim | `Space cs` | Toggle the Aerial symbols outline |
+| i3 | `Super-Return` | Open the first available terminal |
+| i3 | `Super-D` | Open rofi |
+| i3 | `Super-j/k/l/;` | Focus left/down/up/right |
+
+## Neovim setup
+
+The editor graph is built on LazyVim, but both lazy.nvim and LazyVim bootstrap
+at the exact commits recorded in `home/dot_config/nvim/lazy-lock.json`.
+Project-local `.lazy.lua` specs and automatic update checks are disabled.
+
+Basic editing can start while missing tools install asynchronously. For a
+blocking, verifiable provision that returns non-zero on failure, close other
+Neovim instances and run:
+
+```sh
+./scripts/setup-nvim
+```
+
+This command requires `git`, `curl`, a C compiler, `make`, `tar`/`unzip`,
+Node.js with `npm`, and LuaRocks. It:
+
+1. inspects every existing checkout before the real configuration starts;
+2. preserves non-Git, modified, or mismatched plugins under
+ `${XDG_DATA_HOME:-$HOME/.local/share}/nvim/dotfiles-quarantine`;
+3. restores missing plugins from the reviewed lock without running old code;
+4. waits for pinned Mason packages, configured LSP servers, and Tree-sitter
+ parsers to finish; and
+5. verifies receipts, source identities, versions, and repository commits.
+
+One setup lock spans inspection and provisioning. If a hard crash leaves
+`${XDG_STATE_HOME:-$HOME/.local/state}/nvim/dotfiles-setup.lock`, confirm no
+setup or Neovim process is active before removing it.
+
+Provisioning ignores personal/system Git hooks, templates, attributes,
+filters, fsmonitor, and replacement refs. Standard environment variables such
+as `HTTPS_PROXY` and `NO_PROXY` still work; do not depend on a personal Git
+`insteadOf` or proxy rule for this command.
+
+Mason uses the reviewed registry tag `2026-08-10-faulty-close`. Registry
+updates remain explicit dependency reviews because transitive npm/LuaRocks
+artifacts are not all bit-for-bit reproducible. Linux arm64 has no matching
+registry asset for `clangd` or `selene`, so that profile expects a system
+`clangd` and uses `luacheck` for Lua linting.
+
+## Shell and terminal
+
+Shell startup never downloads plugins and every optional integration is
+guarded:
+
+- `eza` enhances `l`, `ll`, `la`, `lg`, `lt`, and `all`; portable `ls`
+ fallbacks remain available.
+- `zoxide` supplies the `z` workflow when installed.
+- `ghq` plus `fzf` enables the Fish `Ctrl-G` repository picker.
+- `lazygit` enables the tmux `Ctrl-T g` popup.
+- `lolcat` and `thefuck` affect presentation or convenience only.
+
+Fish has no runtime plugin manager. The seven nvm.fish 2.2.17 files are an
+intentional, checksummed vendor snapshot under `third_party/nvm.fish/`.
+tmux has no TPM dependency and resolves its adjacent fragments relative to the
+configuration file that was actually sourced.
+
+## Linux/X11 rice
+
+i3/X11 is the stable desktop path. Sway will be a separate profile rather
+than an implicit behavioral replacement.
+
+The full profile expects `rofi`, `feh`, `picom`, `dex`, `i3status`, `xss-lock`,
+`i3lock`, NetworkManager's applet, and PulseAudio/PipeWire-compatible control
+tools. Optional session helpers are guarded, and a missing wallpaper does not
+prevent i3 from starting.
+
+Wallpaper is host data, not shared configuration:
+
+```sh
+mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/wallpapers"
+ln -s /path/to/licensed-wallpaper \
+ "${XDG_DATA_HOME:-$HOME/.local/share}/wallpapers/current"
+```
+
+Do not add artwork without recording its source, author, license, and
+redistribution permission.
+
+## Restore and migration
+
+Every backup path is printed before apply. Restore is preview-first:
+
+```sh
+./scripts/restore /path/to/backup
+./scripts/restore --apply /path/to/backup
+```
+
+The apply form restores files, symlinks, and original directory modes. Files
+first created at paths recorded as absent remain unless removal is separately
+authorized:
+
+```sh
+./scripts/restore --apply --remove-created /path/to/backup
+```
+
+> [!CAUTION]
+> `--remove-created` removes the current regular file or symlink at every
+> recorded-absent path even if it changed after apply. Inspect its preview
+> immediately before use. Restore never removes directories.
+
+### Upgrading the old Fish layout
+
+The pre-chezmoi repository expanded Fisher, z, fish-exa, and fish-ghq directly
+into `~/.config/fish`. Bootstrap detects the 96 retired repository paths and
+leaves them alone by default. Back up and remove only that reviewed set with:
+
+```sh
+./scripts/bootstrap --apply --force --clean-legacy
+```
+
+Legacy cleanup is part of the same rollback transaction. Mutable
+`fish_variables` is never removed automatically; inspect universal variables
+with `fish -c 'set --names --universal'` and erase only values you recognize.
+
+
+Source-state map
+
+Only `home/` is interpreted as chezmoi source state. Infrastructure, licenses,
+Windows registry files, and provenance remain outside it.
+
+| Source | Target |
+| --- | --- |
+| `home/dot_config/fish/` | `$HOME/.config/fish/` |
+| `home/dot_config/nvim/` | `$HOME/.config/nvim/` |
+| `home/dot_config/tmux/` | `$HOME/.config/tmux/` |
+| `home/dot_config/alacritty/` | `$HOME/.config/alacritty/` |
+| `home/dot_config/ranger/rc.conf` | `$HOME/.config/ranger/rc.conf` |
+| `home/dot_config/ranger/executable_scope.sh` | `$HOME/.config/ranger/scope.sh` |
+| `home/dot_config/i3/config` | `$HOME/.config/i3/config` (Linux X11) |
+| `home/dot_config/picom/picom.conf` | `$HOME/.config/picom/picom.conf` (Linux X11) |
+| `home/dot_Xresources` | `$HOME/.Xresources` (Linux X11) |
+| `home/dot_Xmodmap` | `$HOME/.Xmodmap` (Linux X11) |
+| `home/dot_xprofile` | `$HOME/.xprofile` (Linux X11) |
+| `home/executable_dot_xinitrc` | `$HOME/.xinitrc` (Linux X11) |
+
+
+
+## Visual system and provenance
+
+`theme/solarized-osaka.toml` is the palette source of truth. Its revision must
+match the locked Neovim theme. Alacritty, tmux, Fish, and i3 use static,
+reviewable fragments, so startup does not generate theme files or contact a
+network. Checks enforce every mapped color and the key WCAG contrast pairs.
+
+Alacritty alone blends its background at 0.9 opacity; Picom does not fade
+glyphs or whole windows. Red is reserved for failure/urgent states, Fish keeps
+a non-color exit marker, and i3 uses 2 px focus borders.
+
+Vendored or derived work keeps exact upstream revisions, checksums, changes,
+and licenses under `third_party/`, including nvm.fish, ranger's scope script,
+the HSL helper, and Solarized Osaka.
+
+## Performance
+
+Capture a controlled local startup baseline:
+
+```sh
+./scripts/benchmark
+./scripts/benchmark --nvim-data /path/to/isolated/xdg-data/nvim
+```
+
+The benchmark requires Python 3, Fish, and Git; Neovim is optional.
+
+The default run uses a temporary HOME and XDG tree, sanitized Git settings,
+five untimed warm-ups, and 100 measured samples each for unconfigured
+interactive Fish core startup, configured interactive Fish startup, one prompt
+render outside Git, one prompt render in a small local Git repository, and one
+prompt render in a generated repository with 5,000 tracked files.
+Configured Fish remains a host measurement: active optional integrations are
+reported and included. The result records the commit, worktree state,
+operating system, CPU, memory, runtimes, load average, sample count, min, p50,
+p95, p99, and max. Explicit smaller sample counts omit tail percentiles they
+cannot support.
+
+Warm Neovim startup is opt-in. Pass a dedicated, already-provisioned
+`stdpath("data")` directory; the benchmark copies it into the temporary tree,
+verifies all locked plugin checkouts, disables missing-plugin, Mason, and
+Treesitter provisioning in the copied runtime, and leaves the source untouched.
+Its practical 30-sample default reports min, p50, and max. Use
+`--nvim-samples 100` when a tail-percentile run is worth the extra time.
+
+These numbers are observational baselines, not universal CI budgets. Compare
+them on similar hardware with comparable power, thermal, and load conditions,
+then investigate a repeatable regression before changing configuration.
+
+## Validation
+
+Run the same entry point used by CI:
+
+```sh
+./scripts/check
+DOTFILES_CHECK_STRICT=1 ./scripts/check
+DOTFILES_CHECK_NETWORK=1 DOTFILES_CHECK_STRICT=1 ./scripts/check
+DOTFILES_CHECK_NETWORK=1 DOTFILES_CHECK_NVIM_FULL=1 \
+ DOTFILES_CHECK_STRICT=1 ./scripts/check
+```
+
+The suite covers Shell/Fish/Lua/JSON/TOML syntax, formatting, ShellCheck,
+personal-path leakage, Neovim APIs and locks, tmux/i3 parsing, full-tree
+whitespace, provenance checksums, temporary-home chezmoi migration/rollback,
+and signal/path safety. Full network mode additionally performs a clean-XDG
+Neovim start, waits for the pinned toolchain, verifies all 50 repository HEADs,
+and exercises cold Git isolation plus warm drift quarantine.
+
+GitHub Actions installs a checksummed Neovim 0.12.4 and runs the core profile
+on Linux and macOS. Pull requests use the fast offline path. Updates to `main`
+and manual runs also exercise network provisioning, with the full Neovim cold
+start on Linux. Superseded runs are cancelled automatically.
+
+Performance measurements remain local and opt-in; CI validates behavior but
+does not apply hardware-dependent startup thresholds.
+
+## Maintenance
+
+1. Keep configuration, runtime state, secrets, dependencies, and visual assets
+ separate.
+2. Keep optional integrations conditional; core startup must remain useful
+ without them.
+3. Pin or vendor downloaded configuration dependencies with provenance and
+ license information.
+4. Upgrade in reviewable batches and test in a clean home. Stable startup never
+ auto-updates.
+5. Preserve the visual identity through one palette and explicit variants,
+ not host-specific edits.
+
+The portable core, chezmoi migration, locked visual system, and dependency
+canaries are complete. Future work stays practical: continued real-machine
+validation, licensed screenshots, and explicit opaque/high-contrast variants.
+
+## Credits
+
+- [craftzdog/solarized-osaka.nvim](https://github.com/craftzdog/solarized-osaka.nvim)
+ for the palette that defines this rice.
+- [craftzdog/dotfiles-public](https://github.com/craftzdog/dotfiles-public)
+ for the visual-first README inspiration. No screenshots or configuration are
+ copied from that repository.
+
+## License
+
+Repository-authored configuration, scripts, and the palette preview are
+licensed under [MIT](LICENSE). Vendored code retains the license recorded
+beside its provenance metadata.
diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml
deleted file mode 100644
index 9464e9b..0000000
--- a/alacritty/alacritty.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-[font]
-size = 16.0
-
-[font.normal]
-family = "JetBrains Mono Nerd Font"
-style = "Regular"
-
-# You need install fonts first
-# sudo pacman -S yay
-# yay -S nerd-fonts-jetbrains-mono
-
-[window]
-opacity = 0.7
diff --git a/aliases b/aliases
deleted file mode 100644
index f009aa9..0000000
--- a/aliases
+++ /dev/null
@@ -1,6 +0,0 @@
-# manual in chinese ver
-alias cman="man -L zh_CN"
-
-# eza
-alias all="eza -alh --icons --group-directories-first --time-style=long-iso --total-size"
-
diff --git a/fish/completions/fisher.fish b/fish/completions/fisher.fish
deleted file mode 100644
index 6d23ce4..0000000
--- a/fish/completions/fisher.fish
+++ /dev/null
@@ -1,7 +0,0 @@
-complete --command fisher --exclusive --long help --description "Print help"
-complete --command fisher --exclusive --long version --description "Print version"
-complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins"
-complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins"
-complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins"
-complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex"
-complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"
diff --git a/fish/completions/ghq.fish b/fish/completions/ghq.fish
deleted file mode 100644
index 1c6674b..0000000
--- a/fish/completions/ghq.fish
+++ /dev/null
@@ -1,66 +0,0 @@
-function __fish_ghq_needs_command
- set cmd (commandline -opc)
- if [ (count $cmd) -eq 1 -a $cmd[1] = "ghq" ]
- return 0
- end
- return 1
-end
-
-function __fish_ghq_using_command
- set cmd (commandline -opc)
- if [ (count $cmd) -gt 1 ]
- if [ $argv[1] = $cmd[2] ]
- return 0
- end
- end
- return 1
-end
-
-# Help
-function __fish_ghq_help_topics
- for c in get list root create
- printf "%s\thelp topic\n" $c
- end
-end
-
-function __fish_ghq_vcs
- for c in git subversion git-svn mercurial darcs
- printf "%s\tVCS\n" $c
- end
- printf "github\tAlias for git\n"
- printf "svn\tAlias for subversion\n"
- printf "hg\tAlias for mercurial\n"
-end
-
-complete -f -c ghq -n "__fish_ghq_needs_command" -a help -d "Shows a list of commands or help for one command"
-complete -f -c ghq -n "__fish_ghq_using_command help" -a "(__fish_ghq_help_topics)"
-
-complete -f -c ghq -n "__fish_ghq_needs_command" -a get -d "Clone/sync with a remote repository"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l update -s u -d "Update local repository if cloned already"
-complete -f -c ghq -n "__fish_ghq_using_command get" -s p -d "Clone with SSH"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l shallow -d "Do a shallow clone"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l look -s l -d "Look after get"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l vcs -d "Specify VCS backend for cloning" -r -a "(__fish_ghq_vcs)"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l silent -s s -d "Clone or update silently"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l no-recursive -d "Prevent recursive fetching"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l branch -s b -d "Specify branch name. This flag implies --single-branch on Git"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l parallel -s P -d "Import parallely"
-complete -f -c ghq -n "__fish_ghq_using_command get" -l help -s h -d "Show help"
-
-complete -f -c ghq -n "__fish_ghq_needs_command" -a list -d "List local repositories"
-complete -f -c ghq -n "__fish_ghq_using_command list" -l exact -s e -d "Perform an exact match"
-complete -f -c ghq -n "__fish_ghq_using_command list" -l vcs -d "Specify VCS backend for matching" -r -a "(__fish_ghq_vcs)"
-complete -f -c ghq -n "__fish_ghq_using_command list" -l full-path -s p -d "Print full paths"
-complete -f -c ghq -n "__fish_ghq_using_command list" -l unique -d "Print unique subpaths"
-complete -f -c ghq -n "__fish_ghq_using_command list" -l help -s h -d "Show help"
-
-complete -f -c ghq -n "__fish_ghq_needs_command" -a root -d "Show repositories' root"
-complete -f -c ghq -n "__fish_ghq_using_command root" -l all -d "Show all roots"
-complete -f -c ghq -n "__fish_ghq_using_command root" -l help -s h -d "Show help"
-
-complete -f -c ghq -n "__fish_ghq_needs_command" -a create -d "Create a new repository"
-complete -f -c ghq -n "__fish_ghq_using_command create" -l vcs -d "Specify VCS backend explicitly" -r -a "(__fish_ghq_vcs)"
-complete -f -c ghq -n "__fish_ghq_using_command create" -l help -s h -d "Show help"
-
-complete -f -c ghq -n "__fish_ghq_needs_command" -l help -s h -d "Show help"
-complete -f -c ghq -n "__fish_ghq_needs_command" -l version -s v -d "Print the version"
diff --git a/fish/conf.d/fish-exa.fish b/fish/conf.d/fish-exa.fish
deleted file mode 100644
index 5ec5878..0000000
--- a/fish/conf.d/fish-exa.fish
+++ /dev/null
@@ -1,95 +0,0 @@
-function __fish_exa_install --on-event fish-exa_install
- function _set
- if not set --query --universal --export $argv[1]
- set --universal --export $argv[1] $argv[2..-1]
- end
- end
-
- # Prefer eza as exa is unmaintained
- if type -q eza
- set -Ux __FISH_EXA_BINARY eza
- else
- set -Ux __FISH_EXA_BINARY exa
- end
-
- set -Ux __FISH_EXA_BASE_ALIASES l ll lg le lt lc lo
- set -Ux __FISH_EXA_EXPANDED a d i id aa ad ai aid aad aai aaid
- set -Ux __FISH_EXA_EXPANDED_OPT_NAME LA LD LI LID LAA LAD LAI LAID LAAD LAAI LAAID
- set -Ux __FISH_EXA_OPT_NAMES
- set -Ux __FISH_EXA_ALIASES
- set -Ux __FISH_EXA_SORT_OPTIONS name .name size ext mod old acc cr inode
-
- _set EXA_STANDARD_OPTIONS "--group" "--header" "--group-directories-first"
-
- # Base aliases
- _set EXA_L_OPTIONS
- _set EXA_LL_OPTIONS "--long"
- _set EXA_LG_OPTIONS "--git" "--git-ignore" "--long"
- _set EXA_LE_OPTIONS "--extended" "--long"
- _set EXA_LT_OPTIONS "--tree" "--level"
- _set EXA_LC_OPTIONS "--across"
- _set EXA_LO_OPTIONS "--oneline"
-
- # Extended aliases
- _set EXA_LI_OPTIONS "--icons"
- _set EXA_LD_OPTIONS "--only-dirs"
- _set EXA_LID_OPTIONS "--icons" "--only-dirs"
- _set EXA_LA_OPTIONS "--all" "--binary"
- _set EXA_LAD_OPTIONS "--all" "--binary" "--only-dirs"
- _set EXA_LAI_OPTIONS "--all" "--binary" "--icons"
- _set EXA_LAID_OPTIONS "--all" "--binary" "--icons" "--only-dirs"
- _set EXA_LAA_OPTIONS "--all" "--all" "--binary"
- _set EXA_LAAD_OPTIONS "--all" "--all" "--binary" "--only-dirs"
- _set EXA_LAAI_OPTIONS "--all" "--all" "--binary" "--icons"
- _set EXA_LAAID_OPTIONS "--all" "--all" "--binary" "--icons" "--only-dirs"
-
- for a in $__FISH_EXA_BASE_ALIASES
- set -l opt_name (string join '_' "EXA" (string upper $a) "OPTIONS")
- if test $a = "ll"
- alias --save "$a" "exa_git"
- else
- alias --save "$a" "$__FISH_EXA_BINARY \$EXA_STANDARD_OPTIONS \$$opt_name"
- end
- set -a __FISH_EXA_OPT_NAMES "$opt_name"
- set -a __FISH_EXA_ALIASES "$a"
-
- for i in (seq (count $__FISH_EXA_EXPANDED))
- set -l name "$a$__FISH_EXA_EXPANDED[$i]"
- # --tree is useless given --all --all
- if test $name = "ltaa"; or test $name = "ltaac"
- continue
- end
- set -l exp_opt_name (string join '_' "EXA" $__FISH_EXA_EXPANDED_OPT_NAME[$i] "OPTIONS")
- if string match --quiet 'll*' "$name"
- alias --save "$name" "exa_git \$$exp_opt_name"
- else
- alias --save "$name" "$__FISH_EXA_BINARY \$EXA_STANDARD_OPTIONS \$$exp_opt_name \$$opt_name"
- end
- set -a __FISH_EXA_ALIASES "$name"
-
- if not contains $exp_opt_name $__FISH_EXA_OPT_NAMES
- set -a __FISH_EXA_OPT_NAMES $exp_opt_name
- end
- end
- end
-end
-
-function __fish_exa_update --on-event fish-exa_update
- __fish_exa_uninstall
- __fish_exa_install
-end
-
-function __fish_exa_uninstall --on-event fish-exa_uninstall
- for a in $__FISH_EXA_ALIASES
- functions --erase $a
- funcsave $a
- end
-
- set --erase __FISH_EXA_BASE_ALIASES
- set --erase __FISH_EXA_ALIASES
- set --erase __FISH_EXA_EXPANDED
- set --erase __FISH_EXA_EXPANDED_OPT_NAME
- set --erase __FISH_EXA_OPT_NAMES
- set --erase __FISH_EXA_SORT_OPTIONS
- set --erase __FISH_EXA_BINARY
-end
diff --git a/fish/conf.d/ghq_key_bindings.fish b/fish/conf.d/ghq_key_bindings.fish
deleted file mode 100644
index 00e51b8..0000000
--- a/fish/conf.d/ghq_key_bindings.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-bind \cg '__ghq_repository_search'
-if bind -M insert >/dev/null 2>/dev/null
- bind -M insert \cg '__ghq_repository_search'
-end
diff --git a/fish/conf.d/z.fish b/fish/conf.d/z.fish
deleted file mode 100644
index 59c960f..0000000
--- a/fish/conf.d/z.fish
+++ /dev/null
@@ -1,63 +0,0 @@
-if test -z "$Z_DATA"
- if test -z "$XDG_DATA_HOME"
- set -U Z_DATA_DIR "$HOME/.local/share/z"
- else
- set -U Z_DATA_DIR "$XDG_DATA_HOME/z"
- end
- set -U Z_DATA "$Z_DATA_DIR/data"
-end
-
-if test ! -e "$Z_DATA"
- if test ! -e "$Z_DATA_DIR"
- mkdir -p -m 700 "$Z_DATA_DIR"
- end
- touch "$Z_DATA"
-end
-
-if test -z "$Z_CMD"
- set -U Z_CMD z
-end
-
-set -U ZO_CMD "$Z_CMD"o
-
-if test ! -z $Z_CMD
- function $Z_CMD -d "jump around"
- __z $argv
- end
-end
-
-if test ! -z $ZO_CMD
- function $ZO_CMD -d "open target dir"
- __z -d $argv
- end
-end
-
-if not set -q Z_EXCLUDE
- set -U Z_EXCLUDE "^$HOME\$"
-else if contains $HOME $Z_EXCLUDE
- # Workaround: migrate old default values to a regex (see #90).
- set Z_EXCLUDE (string replace -r -- "^$HOME\$" '^'$HOME'$$' $Z_EXCLUDE)
-end
-
-# Setup completions once first
-__z_complete
-
-function __z_on_variable_pwd --on-variable PWD
- __z_add
-end
-
-function __z_uninstall --on-event z_uninstall
- functions -e __z_on_variable_pwd
- functions -e $Z_CMD
- functions -e $ZO_CMD
-
- if test ! -z "$Z_DATA"
- printf "To completely erase z's data, remove:\n" >/dev/stderr
- printf "%s\n" "$Z_DATA" >/dev/stderr
- end
-
- set -e Z_CMD
- set -e ZO_CMD
- set -e Z_DATA
- set -e Z_EXCLUDE
-end
diff --git a/fish/config.fish b/fish/config.fish
deleted file mode 100644
index 07cab47..0000000
--- a/fish/config.fish
+++ /dev/null
@@ -1,63 +0,0 @@
-if status is-interactive
- # Commands to run in interactive sessions can go here
-end
-
-# fisher
-## you should install fisher first via next line command
-## curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
-set -Ux fish_user_paths $fish_user_paths /usr/local/bin
-
-# brew
-## you should install brew first via next line command
-## /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-set -g PATH /opt/homebrew/bin $PATH
-
-# mysql
-set -g PATH /usr/local/mysql/bin $PATH
-
-# golang
-set -Ux GOPATH /Users/m1ng/Documents/PF/data/go
-set -Ux PATH $PATH $GOPATH/bin
-
-thefuck --alias | source
-
-# fish_greeting replaced by maxim
-function fish_greeting
- echo 'Talk is cheap. Show me the code.' | lolcat -a -d 10
-end
-
-# pnpm in mac
-set -gx PNPM_HOME /Users/m1ng/Library/pnpm
-if not string match -q -- $PNPM_HOME $PATH
- set -gx PATH "$PNPM_HOME" $PATH
-end
-# pnpm end
-
-## move from arch
-##function fish_greeting
-#end
-
-# Man in zh_CN, you should install man-pages-zh_cn manual first
-#alias cman="man -L zh_CN"
-#alias all="eza -alh --icons --group-directories-first --time-style=long-iso --total-size"
-
-# When use shadowsocks as proxy you need that
-## set -x ALL_PROXY "socks5h://127.0.0.1:1080"
-## set -x http_proxy "socks5h://127.0.0.1:1080"
-## set -x https_proxy "socks5h://127.0.0.1:1080"
-## set -x http_proxy "http://127.0.0.1:8118"
-
-# Privoxy, filtering proxy for the HTTP protocol
-## set -x https_proxy "https://127.0.0.1:8118"
-## set -x ALL_PROXY "https://127.0.0.1:8118"
-
-### if not set -q NODE_VERSION
-### nvm use lts
-### end
-
-## pnpm in arch
-# set -gx PNPM_HOME "/home/m1ng/.local/share/pnpm"
-# if not string match -q -- $PNPM_HOME $PATH
-# set -gx PATH "$PNPM_HOME" $PATH
-# end
-## pnpm end
diff --git a/fish/fish_plugins b/fish/fish_plugins
deleted file mode 100644
index ee1f030..0000000
--- a/fish/fish_plugins
+++ /dev/null
@@ -1,6 +0,0 @@
-jethrokuan/z
-jorgebucaran/nvm.fish
-simnalamburt/shellder
-decors/fish-ghq
-jorgebucaran/fisher
-gazorby/fish-exa
diff --git a/fish/fish_variables b/fish/fish_variables
deleted file mode 100644
index 56b47b4..0000000
--- a/fish/fish_variables
+++ /dev/null
@@ -1,83 +0,0 @@
-# This file contains fish universal variable definitions.
-# VERSION: 3.0
-SETUVAR --export EXA_LAAD_OPTIONS:\x2d\x2dall\x1e\x2d\x2dall\x1e\x2d\x2dbinary\x1e\x2d\x2donly\x2ddirs
-SETUVAR --export EXA_LAAID_OPTIONS:\x2d\x2dall\x1e\x2d\x2dall\x1e\x2d\x2dbinary\x1e\x2d\x2dicons\x1e\x2d\x2donly\x2ddirs
-SETUVAR --export EXA_LAAI_OPTIONS:\x2d\x2dall\x1e\x2d\x2dall\x1e\x2d\x2dbinary\x1e\x2d\x2dicons
-SETUVAR --export EXA_LAA_OPTIONS:\x2d\x2dall\x1e\x2d\x2dall\x1e\x2d\x2dbinary
-SETUVAR --export EXA_LAD_OPTIONS:\x2d\x2dall\x1e\x2d\x2dbinary\x1e\x2d\x2donly\x2ddirs
-SETUVAR --export EXA_LAID_OPTIONS:\x2d\x2dall\x1e\x2d\x2dbinary\x1e\x2d\x2dicons\x1e\x2d\x2donly\x2ddirs
-SETUVAR --export EXA_LAI_OPTIONS:\x2d\x2dall\x1e\x2d\x2dbinary\x1e\x2d\x2dicons
-SETUVAR --export EXA_LA_OPTIONS:\x2d\x2dall\x1e\x2d\x2dbinary
-SETUVAR --export EXA_LC_OPTIONS:\x2d\x2dacross
-SETUVAR --export EXA_LD_OPTIONS:\x2d\x2donly\x2ddirs
-SETUVAR --export EXA_LE_OPTIONS:\x2d\x2dextended\x1e\x2d\x2dlong
-SETUVAR --export EXA_LG_OPTIONS:\x2d\x2dgit\x1e\x2d\x2dgit\x2dignore\x1e\x2d\x2dlong
-SETUVAR --export EXA_LID_OPTIONS:\x2d\x2dicons\x1e\x2d\x2donly\x2ddirs
-SETUVAR --export EXA_LI_OPTIONS:\x2d\x2dicons
-SETUVAR --export EXA_LL_OPTIONS:\x2d\x2dlong
-SETUVAR --export EXA_LO_OPTIONS:\x2d\x2doneline
-SETUVAR --export EXA_LT_OPTIONS:\x2d\x2dtree\x1e\x2d\x2dlevel
-SETUVAR --export EXA_L_OPTIONS:\x1d
-SETUVAR --export EXA_STANDARD_OPTIONS:\x2d\x2dgroup\x1e\x2d\x2dheader\x1e\x2d\x2dgroup\x2ddirectories\x2dfirst
-SETUVAR --export --path GOPATH:/Users/m1ng/Documents/PF/data/go
-SETUVAR --export --path PATH:/usr/local/mysql/bin\x1e/opt/homebrew/bin\x1e/opt/homebrew/sbin\x1e/opt/homebrew/opt/openjdk/bin\x1e/usr/local/bin\x1e/System/Cryptexes/App/usr/bin\x1e/usr/bin\x1e/bin\x1e/usr/sbin\x1e/sbin\x1e/var/run/com\x2eapple\x2esecurity\x2ecryptexd/codex\x2esystem/bootstrap/usr/local/bin\x1e/var/run/com\x2eapple\x2esecurity\x2ecryptexd/codex\x2esystem/bootstrap/usr/bin\x1e/var/run/com\x2eapple\x2esecurity\x2ecryptexd/codex\x2esystem/bootstrap/usr/appleinternal/bin\x1e/Library/Apple/usr/bin\x1e/Applications/iTerm\x2eapp/Contents/Resources/utilities\x1e/Users/m1ng/Documents/PF/data/go/bin
-SETUVAR ZO_CMD:zo
-SETUVAR Z_CMD:z
-SETUVAR Z_DATA:/Users/m1ng/\x2elocal/share/z/data
-SETUVAR Z_DATA_DIR:/Users/m1ng/\x2elocal/share/z
-SETUVAR Z_EXCLUDE:\x5e/Users/m1ng\x24
-SETUVAR --export __FISH_EXA_ALIASES:l\x1ela\x1eld\x1eli\x1elid\x1elaa\x1elad\x1elai\x1elaid\x1elaad\x1elaai\x1elaaid\x1ell\x1ella\x1elld\x1elli\x1ellid\x1ellaa\x1ellad\x1ellai\x1ellaid\x1ellaad\x1ellaai\x1ellaaid\x1elg\x1elga\x1elgd\x1elgi\x1elgid\x1elgaa\x1elgad\x1elgai\x1elgaid\x1elgaad\x1elgaai\x1elgaaid\x1ele\x1elea\x1eled\x1elei\x1eleid\x1eleaa\x1elead\x1eleai\x1eleaid\x1eleaad\x1eleaai\x1eleaaid\x1elt\x1elta\x1eltd\x1elti\x1eltid\x1eltad\x1eltai\x1eltaid\x1eltaad\x1eltaai\x1eltaaid\x1elc\x1elca\x1elcd\x1elci\x1elcid\x1elcaa\x1elcad\x1elcai\x1elcaid\x1elcaad\x1elcaai\x1elcaaid\x1elo\x1eloa\x1elod\x1eloi\x1eloid\x1eloaa\x1eload\x1eloai\x1eloaid\x1eloaad\x1eloaai\x1eloaaid
-SETUVAR --export __FISH_EXA_BASE_ALIASES:l\x1ell\x1elg\x1ele\x1elt\x1elc\x1elo
-SETUVAR --export __FISH_EXA_BINARY:eza
-SETUVAR --export __FISH_EXA_EXPANDED:a\x1ed\x1ei\x1eid\x1eaa\x1ead\x1eai\x1eaid\x1eaad\x1eaai\x1eaaid
-SETUVAR --export __FISH_EXA_EXPANDED_OPT_NAME:LA\x1eLD\x1eLI\x1eLID\x1eLAA\x1eLAD\x1eLAI\x1eLAID\x1eLAAD\x1eLAAI\x1eLAAID
-SETUVAR --export __FISH_EXA_OPT_NAMES:EXA_L_OPTIONS\x1eEXA_LA_OPTIONS\x1eEXA_LD_OPTIONS\x1eEXA_LI_OPTIONS\x1eEXA_LID_OPTIONS\x1eEXA_LAA_OPTIONS\x1eEXA_LAD_OPTIONS\x1eEXA_LAI_OPTIONS\x1eEXA_LAID_OPTIONS\x1eEXA_LAAD_OPTIONS\x1eEXA_LAAI_OPTIONS\x1eEXA_LAAID_OPTIONS\x1eEXA_LL_OPTIONS\x1eEXA_LG_OPTIONS\x1eEXA_LE_OPTIONS\x1eEXA_LT_OPTIONS\x1eEXA_LC_OPTIONS\x1eEXA_LO_OPTIONS
-SETUVAR --export __FISH_EXA_SORT_OPTIONS:name\x1e\x2ename\x1esize\x1eext\x1emod\x1eold\x1eacc\x1ecr\x1einode
-SETUVAR __fish_initialized:3800
-SETUVAR _fisher_decors_2F_fish_2D_ghq_files:\x7e/\x2econfig/fish/functions/__ghq_repository_search\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/ghq_key_bindings\x2efish\x1e\x7e/\x2econfig/fish/completions/ghq\x2efish
-SETUVAR _fisher_gazorby_2F_fish_2D_exa_files:\x7e/\x2econfig/fish/functions/exa_git\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fish\x2dexa\x2efish
-SETUVAR _fisher_jethrokuan_2F_z_files:\x7e/\x2econfig/fish/functions/__z\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_add\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_clean\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_complete\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/z\x2efish
-SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
-SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish
-SETUVAR _fisher_plugins:jethrokuan/z\x1ejorgebucaran/nvm\x2efish\x1esimnalamburt/shellder\x1edecors/fish\x2dghq\x1ejorgebucaran/fisher\x1egazorby/fish\x2dexa
-SETUVAR _fisher_upgraded_to_4_4:\x1d
-SETUVAR fish_color_autosuggestion:777777
-SETUVAR fish_color_cancel:\x2d\x2dreverse
-SETUVAR fish_color_command:00FF00
-SETUVAR fish_color_comment:30BE30
-SETUVAR fish_color_cwd:green
-SETUVAR fish_color_cwd_root:red
-SETUVAR fish_color_end:FF7B7B
-SETUVAR fish_color_error:A40000
-SETUVAR fish_color_escape:00a6b2
-SETUVAR fish_color_history_current:\x2d\x2dbold
-SETUVAR fish_color_host:normal
-SETUVAR fish_color_host_remote:yellow
-SETUVAR fish_color_keyword:00FF00
-SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
-SETUVAR fish_color_normal:normal
-SETUVAR fish_color_operator:00a6b2
-SETUVAR fish_color_option:30BE30
-SETUVAR fish_color_param:30BE30
-SETUVAR fish_color_quote:44FF44
-SETUVAR fish_color_redirection:7BFF7B
-SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
-SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
-SETUVAR fish_color_status:red
-SETUVAR fish_color_user:brgreen
-SETUVAR fish_color_valid_path:\x2d\x2dunderline
-SETUVAR fish_key_bindings:fish_default_key_bindings
-SETUVAR fish_pager_color_background:\x1d
-SETUVAR fish_pager_color_completion:normal
-SETUVAR fish_pager_color_description:B3A06D
-SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
-SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
-SETUVAR fish_pager_color_secondary_background:\x1d
-SETUVAR fish_pager_color_secondary_completion:\x1d
-SETUVAR fish_pager_color_secondary_description:\x1d
-SETUVAR fish_pager_color_secondary_prefix:\x1d
-SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dbrblack
-SETUVAR fish_pager_color_selected_completion:\x1d
-SETUVAR fish_pager_color_selected_description:\x1d
-SETUVAR fish_pager_color_selected_prefix:\x1d
-SETUVAR --export fish_user_paths:/opt/homebrew/sbin\x1e/opt/homebrew/opt/openjdk/bin\x1e/usr/local/bin
diff --git a/fish/functions/__ghq_repository_search.fish b/fish/functions/__ghq_repository_search.fish
deleted file mode 100644
index fa19d16..0000000
--- a/fish/functions/__ghq_repository_search.fish
+++ /dev/null
@@ -1,22 +0,0 @@
-function __ghq_repository_search -d 'Repository search'
- set -l selector
- [ -n "$GHQ_SELECTOR" ]; and set selector $GHQ_SELECTOR; or set selector fzf
- set -l selector_options
- [ -n "$GHQ_SELECTOR_OPTS" ]; and set selector_options $GHQ_SELECTOR_OPTS
-
- if not type -qf $selector
- printf "\nERROR: '$selector' not found.\n"
- return 1
- end
-
- set -l query (commandline -b)
- [ -n "$query" ]; and set flags --query="$query"; or set flags
- switch "$selector"
- case fzf fzf-tmux peco percol fzy sk
- ghq list --full-path | "$selector" $selector_options $flags | read select
- case \*
- printf "\nERROR: plugin-ghq is not support '$selector'.\n"
- end
- [ -n "$select" ]; and cd "$select"
- commandline -f repaint
-end
diff --git a/fish/functions/__z.fish b/fish/functions/__z.fish
deleted file mode 100644
index 0b02005..0000000
--- a/fish/functions/__z.fish
+++ /dev/null
@@ -1,174 +0,0 @@
-function __z -d "Jump to a recent directory."
- function __print_help -d "Print z help."
- printf "Usage: $Z_CMD [-celrth] string1 string2...\n\n"
- printf " -c --clean Removes directories that no longer exist from $Z_DATA\n"
- printf " -d --dir Opens matching directory using system file manager.\n"
- printf " -e --echo Prints best match, no cd\n"
- printf " -l --list List matches and scores, no cd\n"
- printf " -p --purge Delete all entries from $Z_DATA\n"
- printf " -r --rank Search by rank\n"
- printf " -t --recent Search by recency\n"
- printf " -x --delete Removes the current directory from $Z_DATA\n"
- printf " -h --help Print this help\n\n"
- end
- function __z_legacy_escape_regex
- # taken from escape_string_pcre2 in fish
- # used to provide compatibility with fish 2
- for c in (string split -- '' $argv)
- if contains $c (string split '' '.^$*+()?[{}\\|-]')
- printf \\
- end
- printf '%s' $c
- end
- end
-
- set -l options h/help c/clean e/echo l/list p/purge r/rank t/recent d/directory x/delete
-
- argparse $options -- $argv
-
- if set -q _flag_help
- __print_help
- return 0
- else if set -q _flag_clean
- __z_clean
- printf "%s cleaned!\n" $Z_DATA
- return 0
- else if set -q _flag_purge
- echo >$Z_DATA
- printf "%s purged!\n" $Z_DATA
- return 0
- else if set -q _flag_delete
- sed -i -e "\:^$PWD|.*:d" $Z_DATA
- return 0
- end
-
- set -l typ
-
- if set -q _flag_rank
- set typ rank
- else if set -q _flag_recent
- set typ recent
- end
-
- set -l z_script '
- function frecent(rank, time) {
- dx = t-time
- if( dx < 3600 ) return rank*4
- if( dx < 86400 ) return rank*2
- if( dx < 604800 ) return rank/2
- return rank/4
- }
-
- function output(matches, best_match, common) {
- # list or return the desired directory
- if( list ) {
- cmd = "sort -nr"
- for( x in matches ) {
- if( matches[x] ) {
- printf "%-10s %s\n", matches[x], x | cmd
- }
- }
- } else {
- if( common ) best_match = common
- print best_match
- }
- }
-
- function common(matches) {
- # find the common root of a list of matches, if it exists
- for( x in matches ) {
- if( matches[x] && (!short || length(x) < length(short)) ) {
- short = x
- }
- }
- if( short == "/" ) return
- for( x in matches ) if( matches[x] && index(x, short) != 1 ) {
- return
- }
- return short
- }
-
- BEGIN {
- hi_rank = ihi_rank = -9999999999
- }
- {
- if( typ == "rank" ) {
- rank = $2
- } else if( typ == "recent" ) {
- rank = $3 - t
- } else rank = frecent($2, $3)
- if( $1 ~ q ) {
- matches[$1] = rank
- } else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank
- if( matches[$1] && matches[$1] > hi_rank ) {
- best_match = $1
- hi_rank = matches[$1]
- } else if( imatches[$1] && imatches[$1] > ihi_rank ) {
- ibest_match = $1
- ihi_rank = imatches[$1]
- }
- }
-
- END {
- # prefer case sensitive
- if( best_match ) {
- output(matches, best_match, common(matches))
- } else if( ibest_match ) {
- output(imatches, ibest_match, common(imatches))
- }
- }
- '
-
- set -l qs
- for arg in $argv
- set -l escaped $arg
- if string escape --style=regex '' >/dev/null 2>&1 # use builtin escape if available
- set escaped (string escape --style=regex -- $escaped)
- else
- set escaped (__z_legacy_escape_regex $escaped)
- end
- # Need to escape twice, see https://www.math.utah.edu/docs/info/gawk_5.html#SEC32
- set escaped (string replace --all -- \\ \\\\ $escaped)
- set qs $qs $escaped
- end
- set -l q (string join -- '.*' $qs)
-
- if set -q _flag_list
- # Handle list separately as it can print common path information to stderr
- # which cannot be captured from a subcommand.
- command awk -v t=(date +%s) -v list="list" -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA"
- return
- end
-
- set target (command awk -v t=(date +%s) -v typ="$typ" -v q="$q" -F "|" $z_script "$Z_DATA")
-
- if test "$status" -gt 0
- return
- end
-
- if test -z "$target"
- printf "'%s' did not match any results\n" "$argv"
- return 1
- end
-
- if set -q _flag_echo
- printf "%s\n" "$target"
- else if set -q _flag_directory
- if test -n "$ZO_METHOD"
- type -q "$ZO_METHOD"; and "$ZO_METHOD" "$target"; and return $status
- echo "Cannot open with ZO_METHOD set to $ZO_METHOD"; and return 1
- else if test "$OS" = Windows_NT
- # Be careful, in msys2, explorer always return 1
- type -q explorer; and explorer "$target"
- return 0
- echo "Cannot open file explorer"
- return 1
- else
- type -q xdg-open; and xdg-open "$target"; and return $status
- type -q open; and open "$target"; and return $status
- echo "Not sure how to open file manager"; and return 1
- end
- else
- pushd "$target"
- end
-end
diff --git a/fish/functions/__z_add.fish b/fish/functions/__z_add.fish
deleted file mode 100644
index 20d5d7e..0000000
--- a/fish/functions/__z_add.fish
+++ /dev/null
@@ -1,49 +0,0 @@
-function __z_add -d "Add PATH to .z file"
- test -n "$fish_private_mode"; and return 0
-
- for i in $Z_EXCLUDE
- if string match -r $i $PWD >/dev/null
- return 0 #Path excluded
- end
- end
-
- set -l tmpfile (mktemp $Z_DATA.XXXXXX)
-
- if test -f $tmpfile
- set -l path (string replace --all \\ \\\\ $PWD)
- command awk -v path=$path -v now=(date +%s) -F "|" '
- BEGIN {
- rank[path] = 1
- time[path] = now
- }
- $2 >= 1 {
- if( $1 == path ) {
- rank[$1] = $2 + 1
- time[$1] = now
- }
- else {
- rank[$1] = $2
- time[$1] = $3
- }
- count += $2
- }
- END {
- if( count > 1000 ) {
- for( i in rank ) print i "|" 0.9*rank[i] "|" time[i] # aging
- }
- else for( i in rank ) print i "|" rank[i] "|" time[i]
- }
- ' $Z_DATA 2>/dev/null >$tmpfile
-
- if test ! -z "$Z_OWNER"
- chown $Z_OWNER:(id -ng $Z_OWNER) $tmpfile
- end
- #
- # Don't use redirection here as it can lead to a race condition where $Z_DATA is clobbered.
- # Note: There is a still a possible race condition where an old version of $Z_DATA is
- # read by one instance of Fish before another instance of Fish writes its copy.
- #
- command mv $tmpfile $Z_DATA
- or command rm $tmpfile
- end
-end
diff --git a/fish/functions/__z_clean.fish b/fish/functions/__z_clean.fish
deleted file mode 100644
index ae1721a..0000000
--- a/fish/functions/__z_clean.fish
+++ /dev/null
@@ -1,11 +0,0 @@
-function __z_clean -d "Clean up .z file to remove paths no longer valid"
- set -l tmpfile (mktemp $Z_DATA.XXXXXX)
-
- if test -f $tmpfile
- while read line
- set -l path (string split '|' $line)[1]
- test -d $path; and echo $line
- end <$Z_DATA >$tmpfile
- command mv -f $tmpfile $Z_DATA
- end
-end
diff --git a/fish/functions/__z_complete.fish b/fish/functions/__z_complete.fish
deleted file mode 100644
index a626456..0000000
--- a/fish/functions/__z_complete.fish
+++ /dev/null
@@ -1,13 +0,0 @@
-function __z_complete -d "add completions"
- complete -c $Z_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k
- complete -c $ZO_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k
-
- complete -c $Z_CMD -s c -l clean -d "Cleans out $Z_DATA"
- complete -c $Z_CMD -s e -l echo -d "Prints best match, no cd"
- complete -c $Z_CMD -s l -l list -d "List matches, no cd"
- complete -c $Z_CMD -s p -l purge -d "Purges $Z_DATA"
- complete -c $Z_CMD -s r -l rank -d "Searches by rank, cd"
- complete -c $Z_CMD -s t -l recent -d "Searches by recency, cd"
- complete -c $Z_CMD -s h -l help -d "Print help"
- complete -c $Z_CMD -s x -l delete -d "Removes the current directory from $Z_DATA"
-end
diff --git a/fish/functions/exa_git.fish b/fish/functions/exa_git.fish
deleted file mode 100644
index 10fa9cc..0000000
--- a/fish/functions/exa_git.fish
+++ /dev/null
@@ -1,7 +0,0 @@
-function exa_git -d "Use exa and its git options if in a git repo"
- if git rev-parse --is-inside-work-tree &>/dev/null
- $__FISH_EXA_BINARY $EXA_STANDARD_OPTIONS {$EXA_LL_OPTIONS} --git $argv
- else
- $__FISH_EXA_BINARY $EXA_STANDARD_OPTIONS {$EXA_LL_OPTIONS} $argv
- end
-end
diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish
deleted file mode 100644
index c969ab9..0000000
--- a/fish/functions/fish_prompt.fish
+++ /dev/null
@@ -1,90 +0,0 @@
-function fish_prompt
- set -l __last_command_exit_status $status
-
- if not set -q -g __fish_arrow_functions_defined
- set -g __fish_arrow_functions_defined
- function _git_branch_name
- set -l branch (git symbolic-ref --quiet HEAD 2>/dev/null)
- if set -q branch[1]
- echo (string replace -r '^refs/heads/' '' $branch)
- else
- echo (git rev-parse --short HEAD 2>/dev/null)
- end
- end
-
- function _is_git_dirty
- not command git diff-index --cached --quiet HEAD -- &>/dev/null
- or not command git diff --no-ext-diff --quiet --exit-code &>/dev/null
- end
-
- function _is_git_repo
- type -q git
- or return 1
- git rev-parse --git-dir >/dev/null 2>&1
- end
-
- function _hg_branch_name
- echo (hg branch 2>/dev/null)
- end
-
- function _is_hg_dirty
- set -l stat (hg status -mard 2>/dev/null)
- test -n "$stat"
- end
-
- function _is_hg_repo
- fish_print_hg_root >/dev/null
- end
-
- function _repo_branch_name
- _$argv[1]_branch_name
- end
-
- function _is_repo_dirty
- _is_$argv[1]_dirty
- end
-
- function _repo_type
- if _is_hg_repo
- echo hg
- return 0
- else if _is_git_repo
- echo git
- return 0
- end
- return 1
- end
- end
-
- set -l cyan (set_color -o cyan)
- set -l yellow (set_color -o yellow)
- set -l red (set_color -o red)
- set -l green (set_color -o green)
- set -l blue (set_color -o blue)
- set -l normal (set_color normal)
-
- set -l arrow_color "$green"
- if test $__last_command_exit_status != 0
- set arrow_color "$red"
- end
-
- set -l arrow "$arrow_color➜ "
- if fish_is_root_user
- set arrow "$arrow_color# "
- end
-
- set -l cwd $cyan(prompt_pwd | path basename)
-
- set -l repo_info
- if set -l repo_type (_repo_type)
- set -l repo_branch $red(_repo_branch_name $repo_type)
- set repo_info "$blue $repo_type:($repo_branch$blue)"
-
- if _is_repo_dirty $repo_type
- set -l dirty "$yellow ✗"
- set repo_info "$repo_info$dirty"
- end
- end
-
- echo -n -s $arrow ' '$cwd $repo_info $normal ' '
-end
diff --git a/fish/functions/fisher.fish b/fish/functions/fisher.fish
deleted file mode 100644
index e915cb8..0000000
--- a/fish/functions/fisher.fish
+++ /dev/null
@@ -1,240 +0,0 @@
-function fisher --argument-names cmd --description "A plugin manager for Fish"
- set --query fisher_path || set --local fisher_path $__fish_config_dir
- set --local fisher_version 4.4.5
- set --local fish_plugins $__fish_config_dir/fish_plugins
-
- switch "$cmd"
- case -v --version
- echo "fisher, version $fisher_version"
- case "" -h --help
- echo "Usage: fisher install Install plugins"
- echo " fisher remove Remove installed plugins"
- echo " fisher update Update installed plugins"
- echo " fisher update Update all installed plugins"
- echo " fisher list [] List installed plugins matching regex"
- echo "Options:"
- echo " -v, --version Print version"
- echo " -h, --help Print this help message"
- echo "Variables:"
- echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~
- case ls list
- string match --entire --regex -- "$argv[2]" $_fisher_plugins
- case install update remove
- isatty || read --local --null --array stdin && set --append argv $stdin
-
- set --local install_plugins
- set --local update_plugins
- set --local remove_plugins
- set --local arg_plugins $argv[2..-1]
- set --local old_plugins $_fisher_plugins
- set --local new_plugins
-
- test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins | string replace -- \~ ~)
-
- if ! set --query argv[2]
- if test "$cmd" != update
- echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1
- else if ! set --query file_plugins
- echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
- end
- set arg_plugins $file_plugins
- end
-
- for plugin in $arg_plugins
- set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin)
- contains -- "$plugin" $new_plugins || set --append new_plugins $plugin
- end
-
- if set --query argv[2]
- for plugin in $new_plugins
- if contains -- "$plugin" $old_plugins
- test "$cmd" = remove &&
- set --append remove_plugins $plugin ||
- set --append update_plugins $plugin
- else if test "$cmd" = install
- set --append install_plugins $plugin
- else
- echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1
- end
- end
- else
- for plugin in $new_plugins
- contains -- "$plugin" $old_plugins &&
- set --append update_plugins $plugin ||
- set --append install_plugins $plugin
- end
-
- for plugin in $old_plugins
- contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin
- end
- end
-
- set --local pid_list
- set --local source_plugins
- set --local fetch_plugins $update_plugins $install_plugins
- set --local fish_path (status fish-path)
-
- echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal)
-
- for plugin in $fetch_plugins
- set --local source (command mktemp -d)
- set --append source_plugins $source
-
- command mkdir -p $source/{completions,conf.d,themes,functions}
-
- $fish_path --command "
- if test -e $plugin
- command cp -Rf $plugin/* $source
- else
- set temp (command mktemp -d)
- set repo (string split -- \@ $plugin) || set repo[2] HEAD
-
- if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1])
- set name (string split -- / \$path)[-1]
- set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz
- else
- set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2]
- end
-
- echo Fetching (set_color --underline)\$url(set_color normal)
-
- if command curl -q --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null
- command cp -Rf \$temp/*/* $source
- else
- echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2
- command rm -rf $source
- end
-
- command rm -rf \$temp
- end
-
- set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files
- " &
-
- set --append pid_list (jobs --last --pid)
- end
-
- wait $pid_list 2>/dev/null
-
- for plugin in $fetch_plugins
- if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
- if set --local index (contains --index -- "$plugin" $install_plugins)
- set --erase install_plugins[$index]
- else
- set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)]
- end
- end
- end
-
- for plugin in $update_plugins $remove_plugins
- if set --local index (contains --index -- "$plugin" $_fisher_plugins)
- set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
-
- if contains -- "$plugin" $remove_plugins
- for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var)
- emit {$name}_uninstall
- end
- printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
- set --erase _fisher_plugins[$index]
- end
-
- command rm -rf (string replace -- \~ ~ $$plugin_files_var)
-
- functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var)
-
- for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var)
- complete --erase --command $name
- end
-
- set --erase $plugin_files_var
- end
- end
-
- if set --query update_plugins[1] || set --query install_plugins[1]
- command mkdir -p $fisher_path/{functions,themes,conf.d,completions}
- end
-
- for plugin in $update_plugins $install_plugins
- set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)]
- set --local files $source/{functions,themes,conf.d,completions}/*
-
- if set --local index (contains --index -- $plugin $install_plugins)
- set --local user_files $fisher_path/{functions,themes,conf.d,completions}/*
- set --local conflict_files
-
- for file in (string replace -- $source/ $fisher_path/ $files)
- contains -- $file $user_files && set --append conflict_files $file
- end
-
- if set --query conflict_files[1] && set --erase install_plugins[$index]
- echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2
- continue
- end
- end
-
- for file in (string replace -- $source/ "" $files)
- command cp -RLf $source/$file $fisher_path/$file
- end
-
- set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
-
- set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~)
-
- contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin
- contains -- $plugin $install_plugins && set --local event install || set --local event update
-
- printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
-
- for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~)
- source $file
- if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file)
- emit {$name}_$event
- end
- end
- end
-
- command rm -rf $source_plugins
-
- if set --query _fisher_plugins[1]
- set --local commit_plugins
-
- for plugin in $file_plugins
- contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin
- end
-
- for plugin in $_fisher_plugins
- contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin
- end
-
- string replace --regex -- $HOME \~ $commit_plugins >$fish_plugins
- else
- set --erase _fisher_plugins
- command rm -f $fish_plugins
- end
-
- set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins)
-
- test "$total" != "0 0 0" && echo (string join ", " (
- test $total[1] = 0 || echo "Installed $total[1]") (
- test $total[2] = 0 || echo "Updated $total[2]") (
- test $total[3] = 0 || echo "Removed $total[3]")
- ) plugin/s
- case \*
- echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1
- end
-end
-
-if ! set --query _fisher_upgraded_to_4_4
- set --universal _fisher_upgraded_to_4_4
- if functions --query _fisher_list
- set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share
- command rm -rf $XDG_DATA_HOME/fisher
- functions --erase _fisher_{list,plugin_parse}
- fisher update >/dev/null 2>/dev/null
- else
- for var in (set --names | string match --entire --regex '^_fisher_.+_files$')
- set $var (string replace -- ~ \~ $$var)
- end
- functions --erase _fisher_fish_postexec
- end
-end
diff --git a/fish/functions/l.fish b/fish/functions/l.fish
deleted file mode 100644
index d479e57..0000000
--- a/fish/functions/l.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function l --wraps='eza $EXA_STANDARD_OPTIONS $EXA_L_OPTIONS' --description 'alias l eza $EXA_STANDARD_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/la.fish b/fish/functions/la.fish
deleted file mode 100644
index 1c9f993..0000000
--- a/fish/functions/la.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function la --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_L_OPTIONS' --description 'alias la eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/laa.fish b/fish/functions/laa.fish
deleted file mode 100644
index ae383ff..0000000
--- a/fish/functions/laa.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function laa --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_L_OPTIONS' --description 'alias laa eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/laad.fish b/fish/functions/laad.fish
deleted file mode 100644
index 236d3db..0000000
--- a/fish/functions/laad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function laad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_L_OPTIONS' --description 'alias laad eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/laai.fish b/fish/functions/laai.fish
deleted file mode 100644
index 3fc1fce..0000000
--- a/fish/functions/laai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function laai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_L_OPTIONS' --description 'alias laai eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/laaid.fish b/fish/functions/laaid.fish
deleted file mode 100644
index 6f034a5..0000000
--- a/fish/functions/laaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function laaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_L_OPTIONS' --description 'alias laaid eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/lad.fish b/fish/functions/lad.fish
deleted file mode 100644
index 3af0c90..0000000
--- a/fish/functions/lad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_L_OPTIONS' --description 'alias lad eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/lai.fish b/fish/functions/lai.fish
deleted file mode 100644
index 90ce5e2..0000000
--- a/fish/functions/lai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_L_OPTIONS' --description 'alias lai eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/laid.fish b/fish/functions/laid.fish
deleted file mode 100644
index 6601f36..0000000
--- a/fish/functions/laid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function laid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_L_OPTIONS' --description 'alias laid eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/lc.fish b/fish/functions/lc.fish
deleted file mode 100644
index 20e57e7..0000000
--- a/fish/functions/lc.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lc --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LC_OPTIONS' --description 'alias lc eza $EXA_STANDARD_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lca.fish b/fish/functions/lca.fish
deleted file mode 100644
index 5112880..0000000
--- a/fish/functions/lca.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lca --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LC_OPTIONS' --description 'alias lca eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcaa.fish b/fish/functions/lcaa.fish
deleted file mode 100644
index e6af325..0000000
--- a/fish/functions/lcaa.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcaa --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcaa eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcaad.fish b/fish/functions/lcaad.fish
deleted file mode 100644
index 854a549..0000000
--- a/fish/functions/lcaad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcaad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcaad eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcaai.fish b/fish/functions/lcaai.fish
deleted file mode 100644
index 1dcc58c..0000000
--- a/fish/functions/lcaai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcaai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcaai eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcaaid.fish b/fish/functions/lcaaid.fish
deleted file mode 100644
index ec43967..0000000
--- a/fish/functions/lcaaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcaaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcaaid eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcad.fish b/fish/functions/lcad.fish
deleted file mode 100644
index dae56f8..0000000
--- a/fish/functions/lcad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcad eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcai.fish b/fish/functions/lcai.fish
deleted file mode 100644
index 6074354..0000000
--- a/fish/functions/lcai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcai eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcaid.fish b/fish/functions/lcaid.fish
deleted file mode 100644
index 1e9d873..0000000
--- a/fish/functions/lcaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcaid eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcd.fish b/fish/functions/lcd.fish
deleted file mode 100644
index 7ff2379..0000000
--- a/fish/functions/lcd.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcd --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcd eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lci.fish b/fish/functions/lci.fish
deleted file mode 100644
index 69131ba..0000000
--- a/fish/functions/lci.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lci --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LC_OPTIONS' --description 'alias lci eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/lcid.fish b/fish/functions/lcid.fish
deleted file mode 100644
index 8394d90..0000000
--- a/fish/functions/lcid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lcid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LC_OPTIONS' --description 'alias lcid eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LC_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LC_OPTIONS $argv
-
-end
diff --git a/fish/functions/ld.fish b/fish/functions/ld.fish
deleted file mode 100644
index 41d9fec..0000000
--- a/fish/functions/ld.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ld --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_L_OPTIONS' --description 'alias ld eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/le.fish b/fish/functions/le.fish
deleted file mode 100644
index 4d78950..0000000
--- a/fish/functions/le.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function le --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LE_OPTIONS' --description 'alias le eza $EXA_STANDARD_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/lea.fish b/fish/functions/lea.fish
deleted file mode 100644
index b56079b..0000000
--- a/fish/functions/lea.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lea --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LE_OPTIONS' --description 'alias lea eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/leaa.fish b/fish/functions/leaa.fish
deleted file mode 100644
index cfbe91e..0000000
--- a/fish/functions/leaa.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function leaa --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LE_OPTIONS' --description 'alias leaa eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/leaad.fish b/fish/functions/leaad.fish
deleted file mode 100644
index d197bfd..0000000
--- a/fish/functions/leaad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function leaad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LE_OPTIONS' --description 'alias leaad eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/leaai.fish b/fish/functions/leaai.fish
deleted file mode 100644
index 4171483..0000000
--- a/fish/functions/leaai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function leaai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LE_OPTIONS' --description 'alias leaai eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/leaaid.fish b/fish/functions/leaaid.fish
deleted file mode 100644
index e56286c..0000000
--- a/fish/functions/leaaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function leaaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LE_OPTIONS' --description 'alias leaaid eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/lead.fish b/fish/functions/lead.fish
deleted file mode 100644
index b06f950..0000000
--- a/fish/functions/lead.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lead --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LE_OPTIONS' --description 'alias lead eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/leai.fish b/fish/functions/leai.fish
deleted file mode 100644
index ee9c629..0000000
--- a/fish/functions/leai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function leai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LE_OPTIONS' --description 'alias leai eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/leaid.fish b/fish/functions/leaid.fish
deleted file mode 100644
index ae370da..0000000
--- a/fish/functions/leaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function leaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LE_OPTIONS' --description 'alias leaid eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/led.fish b/fish/functions/led.fish
deleted file mode 100644
index d28c2a4..0000000
--- a/fish/functions/led.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function led --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LE_OPTIONS' --description 'alias led eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/lei.fish b/fish/functions/lei.fish
deleted file mode 100644
index b9587ea..0000000
--- a/fish/functions/lei.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lei --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LE_OPTIONS' --description 'alias lei eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/leid.fish b/fish/functions/leid.fish
deleted file mode 100644
index 37f0d17..0000000
--- a/fish/functions/leid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function leid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LE_OPTIONS' --description 'alias leid eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LE_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LE_OPTIONS $argv
-
-end
diff --git a/fish/functions/lg.fish b/fish/functions/lg.fish
deleted file mode 100644
index f2c09ce..0000000
--- a/fish/functions/lg.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lg --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LG_OPTIONS' --description 'alias lg eza $EXA_STANDARD_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lga.fish b/fish/functions/lga.fish
deleted file mode 100644
index a97bc85..0000000
--- a/fish/functions/lga.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lga --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LG_OPTIONS' --description 'alias lga eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgaa.fish b/fish/functions/lgaa.fish
deleted file mode 100644
index b237663..0000000
--- a/fish/functions/lgaa.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgaa --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgaa eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgaad.fish b/fish/functions/lgaad.fish
deleted file mode 100644
index ee2ab04..0000000
--- a/fish/functions/lgaad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgaad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgaad eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgaai.fish b/fish/functions/lgaai.fish
deleted file mode 100644
index d0c7418..0000000
--- a/fish/functions/lgaai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgaai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgaai eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgaaid.fish b/fish/functions/lgaaid.fish
deleted file mode 100644
index f3112b4..0000000
--- a/fish/functions/lgaaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgaaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgaaid eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgad.fish b/fish/functions/lgad.fish
deleted file mode 100644
index 774db06..0000000
--- a/fish/functions/lgad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgad eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgai.fish b/fish/functions/lgai.fish
deleted file mode 100644
index 41a3478..0000000
--- a/fish/functions/lgai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgai eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgaid.fish b/fish/functions/lgaid.fish
deleted file mode 100644
index 1eb2777..0000000
--- a/fish/functions/lgaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgaid eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgd.fish b/fish/functions/lgd.fish
deleted file mode 100644
index 1a88bfa..0000000
--- a/fish/functions/lgd.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgd --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgd eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgi.fish b/fish/functions/lgi.fish
deleted file mode 100644
index f2e6541..0000000
--- a/fish/functions/lgi.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgi --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgi eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/lgid.fish b/fish/functions/lgid.fish
deleted file mode 100644
index fd83d86..0000000
--- a/fish/functions/lgid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lgid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LG_OPTIONS' --description 'alias lgid eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LG_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LG_OPTIONS $argv
-
-end
diff --git a/fish/functions/li.fish b/fish/functions/li.fish
deleted file mode 100644
index 5d2c087..0000000
--- a/fish/functions/li.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function li --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_L_OPTIONS' --description 'alias li eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/lid.fish b/fish/functions/lid.fish
deleted file mode 100644
index 6c439d1..0000000
--- a/fish/functions/lid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_L_OPTIONS' --description 'alias lid eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_L_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_L_OPTIONS $argv
-
-end
diff --git a/fish/functions/ll.fish b/fish/functions/ll.fish
deleted file mode 100644
index 79ddc13..0000000
--- a/fish/functions/ll.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ll --wraps=exa_git --description 'alias ll exa_git'
- exa_git $argv
-
-end
diff --git a/fish/functions/lla.fish b/fish/functions/lla.fish
deleted file mode 100644
index 85f5f13..0000000
--- a/fish/functions/lla.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lla --wraps='exa_git $EXA_LA_OPTIONS' --description 'alias lla exa_git $EXA_LA_OPTIONS'
- exa_git $EXA_LA_OPTIONS $argv
-
-end
diff --git a/fish/functions/llaa.fish b/fish/functions/llaa.fish
deleted file mode 100644
index fb364b7..0000000
--- a/fish/functions/llaa.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llaa --wraps='exa_git $EXA_LAA_OPTIONS' --description 'alias llaa exa_git $EXA_LAA_OPTIONS'
- exa_git $EXA_LAA_OPTIONS $argv
-
-end
diff --git a/fish/functions/llaad.fish b/fish/functions/llaad.fish
deleted file mode 100644
index b28e0a2..0000000
--- a/fish/functions/llaad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llaad --wraps='exa_git $EXA_LAAD_OPTIONS' --description 'alias llaad exa_git $EXA_LAAD_OPTIONS'
- exa_git $EXA_LAAD_OPTIONS $argv
-
-end
diff --git a/fish/functions/llaai.fish b/fish/functions/llaai.fish
deleted file mode 100644
index d3500f9..0000000
--- a/fish/functions/llaai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llaai --wraps='exa_git $EXA_LAAI_OPTIONS' --description 'alias llaai exa_git $EXA_LAAI_OPTIONS'
- exa_git $EXA_LAAI_OPTIONS $argv
-
-end
diff --git a/fish/functions/llaaid.fish b/fish/functions/llaaid.fish
deleted file mode 100644
index 5324e09..0000000
--- a/fish/functions/llaaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llaaid --wraps='exa_git $EXA_LAAID_OPTIONS' --description 'alias llaaid exa_git $EXA_LAAID_OPTIONS'
- exa_git $EXA_LAAID_OPTIONS $argv
-
-end
diff --git a/fish/functions/llad.fish b/fish/functions/llad.fish
deleted file mode 100644
index d264b6e..0000000
--- a/fish/functions/llad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llad --wraps='exa_git $EXA_LAD_OPTIONS' --description 'alias llad exa_git $EXA_LAD_OPTIONS'
- exa_git $EXA_LAD_OPTIONS $argv
-
-end
diff --git a/fish/functions/llai.fish b/fish/functions/llai.fish
deleted file mode 100644
index 8afda30..0000000
--- a/fish/functions/llai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llai --wraps='exa_git $EXA_LAI_OPTIONS' --description 'alias llai exa_git $EXA_LAI_OPTIONS'
- exa_git $EXA_LAI_OPTIONS $argv
-
-end
diff --git a/fish/functions/llaid.fish b/fish/functions/llaid.fish
deleted file mode 100644
index e3ba5a3..0000000
--- a/fish/functions/llaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llaid --wraps='exa_git $EXA_LAID_OPTIONS' --description 'alias llaid exa_git $EXA_LAID_OPTIONS'
- exa_git $EXA_LAID_OPTIONS $argv
-
-end
diff --git a/fish/functions/lld.fish b/fish/functions/lld.fish
deleted file mode 100644
index 77048a3..0000000
--- a/fish/functions/lld.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lld --wraps='exa_git $EXA_LD_OPTIONS' --description 'alias lld exa_git $EXA_LD_OPTIONS'
- exa_git $EXA_LD_OPTIONS $argv
-
-end
diff --git a/fish/functions/lli.fish b/fish/functions/lli.fish
deleted file mode 100644
index 5faea07..0000000
--- a/fish/functions/lli.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lli --wraps='exa_git $EXA_LI_OPTIONS' --description 'alias lli exa_git $EXA_LI_OPTIONS'
- exa_git $EXA_LI_OPTIONS $argv
-
-end
diff --git a/fish/functions/llid.fish b/fish/functions/llid.fish
deleted file mode 100644
index 6e280af..0000000
--- a/fish/functions/llid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function llid --wraps='exa_git $EXA_LID_OPTIONS' --description 'alias llid exa_git $EXA_LID_OPTIONS'
- exa_git $EXA_LID_OPTIONS $argv
-
-end
diff --git a/fish/functions/lo.fish b/fish/functions/lo.fish
deleted file mode 100644
index c0d7708..0000000
--- a/fish/functions/lo.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lo --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LO_OPTIONS' --description 'alias lo eza $EXA_STANDARD_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loa.fish b/fish/functions/loa.fish
deleted file mode 100644
index d345abe..0000000
--- a/fish/functions/loa.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loa --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LO_OPTIONS' --description 'alias loa eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loaa.fish b/fish/functions/loaa.fish
deleted file mode 100644
index e4b2a90..0000000
--- a/fish/functions/loaa.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loaa --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LO_OPTIONS' --description 'alias loaa eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAA_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loaad.fish b/fish/functions/loaad.fish
deleted file mode 100644
index 01d071d..0000000
--- a/fish/functions/loaad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loaad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LO_OPTIONS' --description 'alias loaad eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loaai.fish b/fish/functions/loaai.fish
deleted file mode 100644
index 6e7e41c..0000000
--- a/fish/functions/loaai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loaai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LO_OPTIONS' --description 'alias loaai eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loaaid.fish b/fish/functions/loaaid.fish
deleted file mode 100644
index 8fe79be..0000000
--- a/fish/functions/loaaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loaaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LO_OPTIONS' --description 'alias loaaid eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/load.fish b/fish/functions/load.fish
deleted file mode 100644
index 8196545..0000000
--- a/fish/functions/load.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function load --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LO_OPTIONS' --description 'alias load eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loai.fish b/fish/functions/loai.fish
deleted file mode 100644
index 08d59f7..0000000
--- a/fish/functions/loai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LO_OPTIONS' --description 'alias loai eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loaid.fish b/fish/functions/loaid.fish
deleted file mode 100644
index 21a3b6e..0000000
--- a/fish/functions/loaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LO_OPTIONS' --description 'alias loaid eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/lod.fish b/fish/functions/lod.fish
deleted file mode 100644
index 9383220..0000000
--- a/fish/functions/lod.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lod --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LO_OPTIONS' --description 'alias lod eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loi.fish b/fish/functions/loi.fish
deleted file mode 100644
index eb63c20..0000000
--- a/fish/functions/loi.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loi --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LO_OPTIONS' --description 'alias loi eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/loid.fish b/fish/functions/loid.fish
deleted file mode 100644
index 241ab9f..0000000
--- a/fish/functions/loid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function loid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LO_OPTIONS' --description 'alias loid eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LO_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LO_OPTIONS $argv
-
-end
diff --git a/fish/functions/lt.fish b/fish/functions/lt.fish
deleted file mode 100644
index ec9acf8..0000000
--- a/fish/functions/lt.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lt --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LT_OPTIONS' --description 'alias lt eza $EXA_STANDARD_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/lta.fish b/fish/functions/lta.fish
deleted file mode 100644
index dbc56af..0000000
--- a/fish/functions/lta.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lta --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LT_OPTIONS' --description 'alias lta eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LA_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltaad.fish b/fish/functions/ltaad.fish
deleted file mode 100644
index 6862bf9..0000000
--- a/fish/functions/ltaad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltaad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltaad eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAD_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltaai.fish b/fish/functions/ltaai.fish
deleted file mode 100644
index 16690e0..0000000
--- a/fish/functions/ltaai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltaai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltaai eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAI_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltaaid.fish b/fish/functions/ltaaid.fish
deleted file mode 100644
index ef075ef..0000000
--- a/fish/functions/ltaaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltaaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltaaid eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAAID_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltad.fish b/fish/functions/ltad.fish
deleted file mode 100644
index dad8e23..0000000
--- a/fish/functions/ltad.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltad --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltad eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAD_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltai.fish b/fish/functions/ltai.fish
deleted file mode 100644
index b1820c3..0000000
--- a/fish/functions/ltai.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltai --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltai eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAI_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltaid.fish b/fish/functions/ltaid.fish
deleted file mode 100644
index 757dcc4..0000000
--- a/fish/functions/ltaid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltaid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltaid eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LAID_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltd.fish b/fish/functions/ltd.fish
deleted file mode 100644
index f29fd06..0000000
--- a/fish/functions/ltd.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltd --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltd eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LD_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/lti.fish b/fish/functions/lti.fish
deleted file mode 100644
index cf04557..0000000
--- a/fish/functions/lti.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function lti --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LT_OPTIONS' --description 'alias lti eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LI_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/fish/functions/ltid.fish b/fish/functions/ltid.fish
deleted file mode 100644
index 94f64d0..0000000
--- a/fish/functions/ltid.fish
+++ /dev/null
@@ -1,4 +0,0 @@
-function ltid --wraps='eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LT_OPTIONS' --description 'alias ltid eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LT_OPTIONS'
- eza $EXA_STANDARD_OPTIONS $EXA_LID_OPTIONS $EXA_LT_OPTIONS $argv
-
-end
diff --git a/home/.chezmoi.toml.tmpl b/home/.chezmoi.toml.tmpl
new file mode 100644
index 0000000..a283e55
--- /dev/null
+++ b/home/.chezmoi.toml.tmpl
@@ -0,0 +1,11 @@
+{{- $linuxX11 := false -}}
+{{- if eq .chezmoi.os "linux" -}}
+{{- $linuxX11 = promptBoolOnce . "profiles.linuxX11" "Enable the Linux X11/i3 profile" false -}}
+{{- end -}}
+
+# Generated during first bootstrap. Later bootstrap runs preserve the existing
+# local config instead of regenerating it.
+sourceDir = {{ .chezmoi.workingTree | quote }}
+
+[data.profiles]
+linuxX11 = {{ $linuxX11 }}
diff --git a/home/.chezmoiignore b/home/.chezmoiignore
new file mode 100644
index 0000000..d9cc2c1
--- /dev/null
+++ b/home/.chezmoiignore
@@ -0,0 +1,26 @@
+{{- /* Patterns match target paths, not source-state names. */ -}}
+{{- if not (or (eq .chezmoi.os "darwin") (eq .chezmoi.os "linux")) }}
+.config
+.config/**
+{{- end }}
+
+{{- if ne .chezmoi.os "darwin" }}
+.config/tmux/macos.conf
+{{- end }}
+
+{{- $linuxX11 := false -}}
+{{- if hasKey . "profiles" -}}
+{{- if hasKey .profiles "linuxX11" -}}
+{{- $linuxX11 = .profiles.linuxX11 -}}
+{{- end -}}
+{{- end -}}
+{{- if not (and (eq .chezmoi.os "linux") $linuxX11) }}
+.Xmodmap
+.Xresources
+.xinitrc
+.xprofile
+.config/i3
+.config/i3/**
+.config/picom
+.config/picom/**
+{{- end }}
diff --git a/i3/.Xmodmap b/home/dot_Xmodmap
similarity index 100%
rename from i3/.Xmodmap
rename to home/dot_Xmodmap
diff --git a/home/dot_Xresources b/home/dot_Xresources
new file mode 100644
index 0000000..0cef861
--- /dev/null
+++ b/home/dot_Xresources
@@ -0,0 +1 @@
+URxvt.font: xft:JetBrainsMono Nerd Font Mono:size=12
diff --git a/home/dot_config/alacritty/alacritty.toml b/home/dot_config/alacritty/alacritty.toml
new file mode 100644
index 0000000..b0a849b
--- /dev/null
+++ b/home/dot_config/alacritty/alacritty.toml
@@ -0,0 +1,43 @@
+[font]
+size = 16.0
+
+[font.normal]
+family = "JetBrainsMono Nerd Font Mono"
+style = "Regular"
+
+# Install the JetBrainsMono Nerd Font Mono family from Nerd Fonts 3.x.
+
+[window]
+# Alacritty blends only its background; Picom keeps the whole window opaque so
+# glyphs remain crisp and readable.
+opacity = 0.9
+
+# Solarized Osaka terminal palette, derived from the repository's locked
+# solarized-osaka.nvim commit f796014c14b1910e08d42cc2077fef34f08e0295.
+# Normal and bright ANSI slots intentionally match the upstream terminal map.
+[colors]
+transparent_background_colors = false
+
+[colors.primary]
+background = "#001419"
+foreground = "#839395"
+
+[colors.normal]
+black = "#001014"
+red = "#db302d"
+green = "#849900"
+yellow = "#b28500"
+blue = "#268bd3"
+magenta = "#d23681"
+cyan = "#29a298"
+white = "#839395"
+
+[colors.bright]
+black = "#001014"
+red = "#db302d"
+green = "#849900"
+yellow = "#b28500"
+blue = "#268bd3"
+magenta = "#d23681"
+cyan = "#29a298"
+white = "#839395"
diff --git a/fish/completions/nvm.fish b/home/dot_config/fish/completions/nvm.fish
similarity index 100%
rename from fish/completions/nvm.fish
rename to home/dot_config/fish/completions/nvm.fish
diff --git a/home/dot_config/fish/conf.d/00_xdg_defaults.fish b/home/dot_config/fish/conf.d/00_xdg_defaults.fish
new file mode 100644
index 0000000..0e55ecd
--- /dev/null
+++ b/home/dot_config/fish/conf.d/00_xdg_defaults.fish
@@ -0,0 +1,17 @@
+# XDG variables that are empty or relative are invalid and must be treated as
+# unset. Normalize them before vendored conf.d integrations read their values.
+if not set -q XDG_CONFIG_HOME; or test -z "$XDG_CONFIG_HOME"; or not string match -q '/*' -- "$XDG_CONFIG_HOME"
+ set -gx XDG_CONFIG_HOME "$HOME/.config"
+end
+
+if not set -q XDG_DATA_HOME; or test -z "$XDG_DATA_HOME"; or not string match -q '/*' -- "$XDG_DATA_HOME"
+ set -gx XDG_DATA_HOME "$HOME/.local/share"
+end
+
+if not set -q XDG_STATE_HOME; or test -z "$XDG_STATE_HOME"; or not string match -q '/*' -- "$XDG_STATE_HOME"
+ set -gx XDG_STATE_HOME "$HOME/.local/state"
+end
+
+if not set -q XDG_CACHE_HOME; or test -z "$XDG_CACHE_HOME"; or not string match -q '/*' -- "$XDG_CACHE_HOME"
+ set -gx XDG_CACHE_HOME "$HOME/.cache"
+end
diff --git a/home/dot_config/fish/conf.d/eza.fish b/home/dot_config/fish/conf.d/eza.fish
new file mode 100644
index 0000000..db404db
--- /dev/null
+++ b/home/dot_config/fish/conf.d/eza.fish
@@ -0,0 +1,17 @@
+status is-interactive; or return
+
+if command -q eza
+ alias l 'command eza --group-directories-first --icons=auto'
+ alias ll 'command eza --long --header --group-directories-first --icons=auto'
+ alias la 'command eza --all --long --header --group-directories-first --icons=auto'
+ alias lg 'command eza --long --header --git --group-directories-first --icons=auto'
+ alias lt 'command eza --tree --level=2 --group-directories-first --icons=auto'
+ alias all 'command eza --all --long --header --git --group-directories-first --icons=auto --time-style=long-iso'
+else
+ alias l 'command ls'
+ alias ll 'command ls -lh'
+ alias la 'command ls -lAh'
+ alias lg 'command ls -lh'
+ alias lt 'command ls -lAh'
+ alias all 'command ls -lAh'
+end
diff --git a/home/dot_config/fish/conf.d/m1ng_ghq_key_bindings.fish b/home/dot_config/fish/conf.d/m1ng_ghq_key_bindings.fish
new file mode 100644
index 0000000..813dbaf
--- /dev/null
+++ b/home/dot_config/fish/conf.d/m1ng_ghq_key_bindings.fish
@@ -0,0 +1,7 @@
+status is-interactive; or return
+command -q ghq; and command -q fzf; or return
+
+bind \cg __m1ng_ghq_repository_search
+if bind -M insert >/dev/null 2>/dev/null
+ bind -M insert \cg __m1ng_ghq_repository_search
+end
diff --git a/fish/conf.d/nvm.fish b/home/dot_config/fish/conf.d/nvm.fish
similarity index 100%
rename from fish/conf.d/nvm.fish
rename to home/dot_config/fish/conf.d/nvm.fish
diff --git a/home/dot_config/fish/conf.d/zoxide.fish b/home/dot_config/fish/conf.d/zoxide.fish
new file mode 100644
index 0000000..e05db3b
--- /dev/null
+++ b/home/dot_config/fish/conf.d/zoxide.fish
@@ -0,0 +1,4 @@
+status is-interactive; or return
+command -q zoxide; or return
+
+command zoxide init fish | source
diff --git a/home/dot_config/fish/config.fish b/home/dot_config/fish/config.fish
new file mode 100644
index 0000000..5925938
--- /dev/null
+++ b/home/dot_config/fish/config.fish
@@ -0,0 +1,71 @@
+# Keep environment setup deterministic and process-local. fish_add_path is
+# idempotent and ignores directories that do not exist; --global prevents it
+# from writing machine-specific universal variables.
+fish_add_path --global \
+ "$HOME/.local/bin" \
+ /opt/homebrew/bin \
+ /opt/homebrew/sbin \
+ /usr/local/bin \
+ /usr/local/sbin \
+ /usr/local/mysql/bin
+
+# Go installs commands into GOBIN when it is set, otherwise into the first
+# GOPATH workspace's bin directory. Fish imports GOPATH as a path variable, so
+# selecting its first element also handles a colon-separated inherited value.
+set -l go_bin "$HOME/go/bin"
+if set -q GOBIN; and test -n "$GOBIN"; and string match -q '/*' -- "$GOBIN"
+ set go_bin "$GOBIN"
+else if set -q GOPATH; and test -n "$GOPATH[1]"
+ set go_bin "$GOPATH[1]/bin"
+end
+fish_add_path --global "$go_bin"
+
+# pnpm uses different default homes on macOS and Linux. An existing
+# PNPM_HOME always wins, so machine or work-specific overrides stay local.
+if not set -q PNPM_HOME; and command -q uname
+ switch (command uname -s 2>/dev/null)
+ case Darwin
+ set -gx PNPM_HOME "$HOME/Library/pnpm"
+ case Linux
+ set -l data_home "$HOME/.local/share"
+ if set -q XDG_DATA_HOME
+ set data_home "$XDG_DATA_HOME"
+ end
+ set -gx PNPM_HOME "$data_home/pnpm"
+ end
+end
+
+if set -q PNPM_HOME; and test -n "$PNPM_HOME"
+ fish_add_path --global "$PNPM_HOME"
+end
+
+# Everything below is presentation or interactive workflow integration. Keep
+# it out of non-interactive shells and degrade quietly when a tool is absent.
+if status is-interactive
+ if command -q thefuck
+ thefuck --alias | source
+ end
+
+ if command -q man
+ # Locale environment variables work with both BSD man and man-db;
+ # man-db's -L flag is not available on macOS.
+ alias cman 'env LC_ALL=zh_CN.UTF-8 man'
+ end
+
+ function fish_greeting
+ set -l maxim 'Talk is cheap. Show me the code.'
+ if command -q lolcat
+ # Keep the rice without delaying every new interactive shell with
+ # lolcat's animation loop.
+ printf '%s\n' "$maxim" | command lolcat
+ else
+ printf '%s\n' "$maxim"
+ end
+ end
+end
+
+# Optional local examples (keep credentials and host-specific values out of
+# the repository):
+# set -gx ALL_PROXY socks5h://127.0.0.1:1080
+# set -gx http_proxy http://127.0.0.1:8118
+# set -gx https_proxy http://127.0.0.1:8118
diff --git a/home/dot_config/fish/functions/__m1ng_ghq_repository_search.fish b/home/dot_config/fish/functions/__m1ng_ghq_repository_search.fish
new file mode 100644
index 0000000..8ab7e21
--- /dev/null
+++ b/home/dot_config/fish/functions/__m1ng_ghq_repository_search.fish
@@ -0,0 +1,16 @@
+function __m1ng_ghq_repository_search --description 'Select a ghq repository with fzf'
+ if not command -q ghq; or not command -q fzf
+ printf 'ghq repository search requires both ghq and fzf\n' >&2
+ return 127
+ end
+
+ set -l query (commandline --current-buffer)
+ set -l selected (command ghq list --full-path 2>/dev/null | command fzf --query "$query" --select-1 --exit-0)
+
+ if test -n "$selected"
+ cd -- "$selected"
+ commandline --replace ''
+ end
+
+ commandline -f repaint
+end
diff --git a/fish/functions/_nvm_index_update.fish b/home/dot_config/fish/functions/_nvm_index_update.fish
similarity index 100%
rename from fish/functions/_nvm_index_update.fish
rename to home/dot_config/fish/functions/_nvm_index_update.fish
diff --git a/fish/functions/_nvm_list.fish b/home/dot_config/fish/functions/_nvm_list.fish
similarity index 100%
rename from fish/functions/_nvm_list.fish
rename to home/dot_config/fish/functions/_nvm_list.fish
diff --git a/fish/functions/_nvm_version_activate.fish b/home/dot_config/fish/functions/_nvm_version_activate.fish
similarity index 100%
rename from fish/functions/_nvm_version_activate.fish
rename to home/dot_config/fish/functions/_nvm_version_activate.fish
diff --git a/fish/functions/_nvm_version_deactivate.fish b/home/dot_config/fish/functions/_nvm_version_deactivate.fish
similarity index 100%
rename from fish/functions/_nvm_version_deactivate.fish
rename to home/dot_config/fish/functions/_nvm_version_deactivate.fish
diff --git a/home/dot_config/fish/functions/fish_prompt.fish b/home/dot_config/fish/functions/fish_prompt.fish
new file mode 100644
index 0000000..9b9d10e
--- /dev/null
+++ b/home/dot_config/fish/functions/fish_prompt.fish
@@ -0,0 +1,66 @@
+function fish_prompt --description 'M1NGSAMA prompt'
+ set -l last_status $status
+ # Solarized Osaka palette from locked commit f796014c14b1910e08d42cc2077fef34f08e0295.
+ set -l osaka_red db302d
+ set -l osaka_magenta d23681
+ set -l osaka_blue 268bd3
+ set -l osaka_cyan 29a298
+ set -l osaka_green 849900
+ set -l osaka_yellow b28500
+
+ set -l marker_color $osaka_green
+ if test $last_status -ne 0
+ set marker_color $osaka_red
+ # The marker and status number remain meaningful without colour.
+ set_color --bold $osaka_red
+ printf '!%d ' $last_status
+ end
+
+ set_color --bold $marker_color
+ if fish_is_root_user
+ printf '# '
+ else
+ printf '➜ '
+ end
+
+ set_color --bold $osaka_cyan
+ printf '%s' (prompt_pwd)
+
+ if command -q git
+ # One porcelain-v2 query provides both branch and worktree state. This
+ # avoids spawning three Git processes on every prompt refresh.
+ set -l git_status (command git --no-optional-locks status \
+ --porcelain=v2 --branch \
+ --ignore-submodules=dirty --untracked-files=no \
+ 2>/dev/null)
+ if test $status -ne 0
+ set git_status
+ end
+
+ set -l branch_line (string match -- '# branch.head *' $git_status)
+ set -l branch (string replace -- '# branch.head ' '' $branch_line)
+ if test "$branch" = '(detached)'
+ set -l oid_line (string match -- '# branch.oid *' $git_status)
+ set -l oid (string replace -- '# branch.oid ' '' $oid_line)
+ set branch (string sub --length 7 -- "$oid")
+ end
+
+ if test -n "$branch"
+ set_color --bold $osaka_blue
+ printf ' git:('
+ set_color --bold $osaka_magenta
+ printf '%s' "$branch"
+ set_color --bold $osaka_blue
+ printf ')'
+ end
+
+ set -l changes (string match --invert --regex '^# ' $git_status)
+ if test -n "$changes"
+ set_color --bold $osaka_yellow
+ printf ' *'
+ end
+ end
+
+ set_color normal
+ printf ' '
+end
diff --git a/fish/functions/nvm.fish b/home/dot_config/fish/functions/nvm.fish
similarity index 100%
rename from fish/functions/nvm.fish
rename to home/dot_config/fish/functions/nvm.fish
diff --git a/i3/config b/home/dot_config/i3/config
similarity index 67%
rename from i3/config
rename to home/dot_config/i3/config
index 84ed702..bb4ab35 100644
--- a/i3/config
+++ b/home/dot_config/i3/config
@@ -11,9 +11,23 @@
set $mod Mod4
+# Solarized Osaka palette from the repository's locked solarized-osaka.nvim
+# commit f796014c14b1910e08d42cc2077fef34f08e0295.
+set $osaka_bg #001419
+set $osaka_surface #002c38
+set $osaka_base02 #063540
+set $osaka_base01 #576d74
+set $osaka_fg #839395
+set $osaka_base0 #9eabac
+set $osaka_white #ffffff
+set $osaka_yellow #b28500
+set $osaka_red #db302d
+set $osaka_blue #268bd3
+set $osaka_cyan #29a298
+
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
-font pango:monospace 10
+font pango:JetBrainsMono Nerd Font Mono, DejaVu Sans Mono, monospace 10
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
@@ -21,22 +35,25 @@ font pango:monospace 10
# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
-exec --no-startup-id dex --autostart --environment i3
+exec --no-startup-id sh -c 'command -v dex >/dev/null 2>&1 && exec dex --autostart --environment i3'
-exec --no-startup-id feh --bg-fill /home/m1ng/Downloads/oshino.png
+# An optional `current` file or symlink keeps host-specific wallpaper choices
+# out of the shared config. Missing wallpaper/feh is intentionally harmless.
+exec --no-startup-id sh -c 'wallpaper="${XDG_DATA_HOME:-$HOME/.local/share}/wallpapers/current"; if [ -r "$wallpaper" ] && command -v feh >/dev/null 2>&1; then feh --no-fehbg --bg-fill "$wallpaper"; fi'
-exec_always --no-startup-id picom -b
+# `exec` runs only at session start, avoiding duplicate compositors on reload.
+exec --no-startup-id sh -c 'command -v picom >/dev/null 2>&1 && exec picom -b'
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
-exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
+exec --no-startup-id sh -c 'command -v xss-lock >/dev/null 2>&1 && command -v i3lock >/dev/null 2>&1 && exec xss-lock --transfer-sleep-lock -- i3lock --nofork'
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
-exec --no-startup-id nm-applet
+exec --no-startup-id sh -c 'command -v nm-applet >/dev/null 2>&1 && exec nm-applet'
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
@@ -52,8 +69,8 @@ floating_modifier $mod
# or left-clicking anywhere into the window while holding the floating modifier.
tiling_drag modifier titlebar
-# start a terminal
-bindsym $mod+Return exec i3-sensible-terminal
+# Prefer the themed terminal, while retaining distro-standard fallbacks.
+bindsym $mod+Return exec --no-startup-id sh -c 'if command -v alacritty >/dev/null 2>&1; then exec alacritty; elif command -v i3-sensible-terminal >/dev/null 2>&1; then exec i3-sensible-terminal; elif command -v x-terminal-emulator >/dev/null 2>&1; then exec x-terminal-emulator; elif command -v xterm >/dev/null 2>&1; then exec xterm; else i3-nagbar -t error -m "No terminal emulator found"; fi'
# kill focused window
bindsym $mod+q kill
@@ -193,8 +210,31 @@ bindsym $mod+r mode "resize"
# finds out, if available)
bar {
status_command i3status
+ colors {
+ background $osaka_bg
+ statusline $osaka_base0
+ separator $osaka_base01
+
+ # class border background text
+ focused_workspace $osaka_blue $osaka_blue $osaka_bg
+ active_workspace $osaka_base02 $osaka_base02 $osaka_base0
+ inactive_workspace $osaka_bg $osaka_bg $osaka_fg
+ urgent_workspace $osaka_red $osaka_red $osaka_white
+ binding_mode $osaka_yellow $osaka_yellow $osaka_bg
+ }
}
gaps inner 3
gaps outer 0
-for_window [class="^.*"] border pixel 0
+
+# Pixel borders preserve the riced look without hiding keyboard focus.
+default_border pixel 2
+default_floating_border pixel 2
+
+# class border background text indicator child_border
+client.focused $osaka_blue $osaka_blue $osaka_bg $osaka_cyan $osaka_blue
+client.focused_inactive $osaka_base02 $osaka_base02 $osaka_base0 $osaka_surface $osaka_base02
+client.unfocused $osaka_surface $osaka_bg $osaka_fg $osaka_surface $osaka_surface
+client.urgent $osaka_red $osaka_red $osaka_white $osaka_red $osaka_red
+client.placeholder $osaka_surface $osaka_bg $osaka_fg $osaka_surface $osaka_surface
+client.background $osaka_bg
diff --git a/nvim/init.lua b/home/dot_config/nvim/init.lua
similarity index 100%
rename from nvim/init.lua
rename to home/dot_config/nvim/init.lua
diff --git a/nvim/lazy-lock.json b/home/dot_config/nvim/lazy-lock.json
similarity index 90%
rename from nvim/lazy-lock.json
rename to home/dot_config/nvim/lazy-lock.json
index 3ae6d1a..9382725 100644
--- a/nvim/lazy-lock.json
+++ b/home/dot_config/nvim/lazy-lock.json
@@ -1,6 +1,7 @@
{
"LazyVim": { "branch": "main", "commit": "dc1ffa5bcb66f46284f91a8593dda5c7c54a1824" },
"SchemaStore.nvim": { "branch": "main", "commit": "8e17e50b519ba360bcfd5dfb5843ccac9be500ba" },
+ "aerial.nvim": { "branch": "master", "commit": "28fe6e822ae344544c379d60fcb13c9519a1f08a" },
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "c89184526212e04feffbddda9d06b041a8fca416" },
@@ -11,13 +12,11 @@
"git.nvim": { "branch": "main", "commit": "70ceb406568132aec754b25b46ebda1a05dd46f0" },
"gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" },
"grug-far.nvim": { "branch": "main", "commit": "48f9afb684de1c191af7bed96bc1db85ba33f6a4" },
- "image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" },
"inc-rename.nvim": { "branch": "main", "commit": "7c79416330364976955ec8059fe3832b72ee1271" },
"incline.nvim": { "branch": "main", "commit": "0fd2d5a27504dba7fdc507a53275f22c081fe640" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "258d2a5ef4a3e3d6d9ba9da72c9725c53e9afcbd" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
- "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "155eac5d8609a2f110041f8ac3491664cc126354" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" },
@@ -35,13 +34,12 @@
"nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" },
- "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"refactoring.nvim": { "branch": "master", "commit": "74b608dfee827c2372250519d433cc21cb083407" },
- "rustaceanvim": { "branch": "master", "commit": "7c9271934d926969e920f7da932da6ba234b1e5a" },
+ "render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" },
+ "rustaceanvim": { "branch": "main", "commit": "7c9271934d926969e920f7da932da6ba234b1e5a" },
"snacks.nvim": { "branch": "main", "commit": "bfe8c26dbd83f7c4fbc222787552e29b4eccfcc0" },
"solarized-osaka.nvim": { "branch": "main", "commit": "f796014c14b1910e08d42cc2077fef34f08e0295" },
- "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
diff --git a/home/dot_config/nvim/lazyvim.json b/home/dot_config/nvim/lazyvim.json
new file mode 100644
index 0000000..989554d
--- /dev/null
+++ b/home/dot_config/nvim/lazyvim.json
@@ -0,0 +1,17 @@
+{
+ "extras": [
+ "lazyvim.plugins.extras.formatting.prettier",
+ "lazyvim.plugins.extras.lang.json",
+ "lazyvim.plugins.extras.lang.rust",
+ "lazyvim.plugins.extras.lang.tailwind",
+ "lazyvim.plugins.extras.lang.typescript",
+ "lazyvim.plugins.extras.linting.eslint",
+ "lazyvim.plugins.extras.util.mini-hipatterns"
+ ],
+ "install_version": 8,
+ "news": {
+ "NEWS.md": "11866",
+ "doc/news.txt": "25358"
+ },
+ "version": 8
+}
diff --git a/nvim/lua/config/autocmds.lua b/home/dot_config/nvim/lua/config/autocmds.lua
similarity index 100%
rename from nvim/lua/config/autocmds.lua
rename to home/dot_config/nvim/lua/config/autocmds.lua
diff --git a/nvim/lua/config/keymaps.lua b/home/dot_config/nvim/lua/config/keymaps.lua
similarity index 93%
rename from nvim/lua/config/keymaps.lua
rename to home/dot_config/nvim/lua/config/keymaps.lua
index eb1e725..bfe74e9 100644
--- a/nvim/lua/config/keymaps.lua
+++ b/home/dot_config/nvim/lua/config/keymaps.lua
@@ -60,10 +60,10 @@ keymap.set("n", "", "-")
-- Diagnostics
keymap.set("n", "", function()
- vim.diagnostic.goto_next()
+ vim.diagnostic.jump({ count = 1 })
end, opts)
-keymap.set("n", "mp", "MarkdownPreview", { desc = "Markdown Preview" })
+keymap.set("n", "mp", "RenderMarkdown preview", { desc = "Markdown Preview" })
keymap.set("n", "r", function()
require("m1ngsama.hsl").replaceHexWithHSL()
diff --git a/home/dot_config/nvim/lua/config/lazy.lua b/home/dot_config/nvim/lua/config/lazy.lua
new file mode 100644
index 0000000..fcf47f3
--- /dev/null
+++ b/home/dot_config/nvim/lua/config/lazy.lua
@@ -0,0 +1,143 @@
+local lazy_root = vim.fn.stdpath("data") .. "/lazy"
+local lazy_commit = "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a"
+local lazyvim_commit = "dc1ffa5bcb66f46284f91a8593dda5c7c54a1824"
+local benchmark = vim.g.dotfiles_benchmark == 1
+
+local function bootstrap_plugin(name, url, commit, branch)
+ local plugin_path = lazy_root .. "/" .. name
+ local plugin_stat = vim.uv.fs_lstat(plugin_path)
+ if plugin_stat then
+ if plugin_stat.type ~= "directory" then
+ error(("%s bootstrap refused a non-directory or symlink checkout: %s"):format(name, plugin_path))
+ end
+ return plugin_path
+ end
+
+ local plugin_stage = plugin_path .. ".bootstrap." .. vim.fn.getpid()
+ local function bootstrap_error(message, output)
+ vim.fn.delete(plugin_stage, "rf")
+ error(("%s bootstrap failed: %s\n%s"):format(name, message, vim.trim(output or "")))
+ end
+ local function run(command)
+ local output = vim.fn.system(command)
+ if vim.v.shell_error ~= 0 then
+ bootstrap_error(table.concat(command, " "), output)
+ end
+ end
+
+ vim.fn.mkdir(lazy_root, "p")
+ vim.fn.delete(plugin_stage, "rf")
+ vim.fn.mkdir(plugin_stage, "p")
+ run({ "git", "-C", plugin_stage, "init", "--quiet" })
+ run({ "git", "-C", plugin_stage, "remote", "add", "origin", url })
+ -- Keep the checkout deterministic while retaining the default-branch refs
+ -- lazy.nvim needs when it writes the lock file after a first install.
+ run({
+ "git",
+ "-C",
+ plugin_stage,
+ "fetch",
+ "--quiet",
+ "--depth=1",
+ "--filter=blob:none",
+ "origin",
+ commit .. ":refs/remotes/origin/" .. branch,
+ })
+ run({
+ "git",
+ "-C",
+ plugin_stage,
+ "symbolic-ref",
+ "refs/remotes/origin/HEAD",
+ "refs/remotes/origin/" .. branch,
+ })
+ run({ "git", "-C", plugin_stage, "checkout", "--quiet", "--detach", commit })
+
+ local renamed, rename_error = vim.uv.fs_rename(plugin_stage, plugin_path)
+ if not renamed then
+ -- A concurrent Neovim may have completed the same atomic bootstrap.
+ if vim.uv.fs_stat(plugin_path) then
+ vim.fn.delete(plugin_stage, "rf")
+ else
+ bootstrap_error("could not install the staged checkout", rename_error)
+ end
+ end
+ return plugin_path
+end
+
+local lazypath = bootstrap_plugin("lazy.nvim", "https://github.com/folke/lazy.nvim.git", lazy_commit, "main")
+-- LazyVim provides imported specs. Installing it before setup makes the full
+-- graph visible in the first lock-aware install pass, so early partial passes
+-- cannot discard still-unseen lock entries and replace them with branch tips.
+bootstrap_plugin("LazyVim", "https://github.com/LazyVim/LazyVim.git", lazyvim_commit, "main")
+vim.opt.rtp:prepend(lazypath)
+
+require("lazy").setup({
+ -- The repository lock is the complete plugin graph. Do not let a project's
+ -- local .lazy.lua silently add an unreviewed dependency on startup.
+ local_spec = false,
+ -- Local performance measurements use an already-provisioned copy and must
+ -- never turn a timing sample into dependency installation.
+ install = { missing = not benchmark },
+ spec = {
+ -- add LazyVim and import its plugins
+ {
+ "LazyVim/LazyVim",
+ import = "lazyvim.plugins",
+ opts = {
+ colorscheme = "solarized-osaka",
+ news = {
+ lazyvim = true,
+ neovim = true,
+ },
+ },
+ },
+ { import = "plugins" },
+ },
+ defaults = {
+ -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
+ -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
+ lazy = false,
+ -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
+ -- have outdated releases, which may break your Neovim install.
+ version = false, -- always use the latest git commit
+ -- version = "*", -- try installing the latest stable version for plugins that support semver
+ },
+ dev = {
+ path = "~/.ghq/github.com",
+ },
+ -- The graph is Git-locked. Disable package/rock discovery so a repository
+ -- rockspec cannot introduce a second, unpinned dependency channel.
+ pkg = { enabled = false },
+ -- Keep normal startup offline and deterministic. Review updates explicitly
+ -- with :Lazy check, then restore or update the committed lock as intended.
+ checker = { enabled = false },
+ performance = {
+ cache = {
+ enabled = true,
+ -- disable_events = {},
+ },
+ rtp = {
+ -- disable some rtp plugins
+ disabled_plugins = {
+ "gzip",
+ -- "matchit",
+ "matchparen", -- using vim-matchup or other alternatives
+ "netrwPlugin",
+ "rplugin",
+ "tarPlugin",
+ "tohtml",
+ "tutor",
+ "zipPlugin",
+ },
+ },
+ },
+ ui = {
+ custom_keys = {
+ ["d"] = function(plugin)
+ dd(plugin)
+ end,
+ },
+ },
+ debug = false,
+})
diff --git a/nvim/lua/config/options.lua b/home/dot_config/nvim/lua/config/options.lua
similarity index 100%
rename from nvim/lua/config/options.lua
rename to home/dot_config/nvim/lua/config/options.lua
diff --git a/nvim/lua/m1ngsama/discipline.lua b/home/dot_config/nvim/lua/m1ngsama/discipline.lua
similarity index 100%
rename from nvim/lua/m1ngsama/discipline.lua
rename to home/dot_config/nvim/lua/m1ngsama/discipline.lua
diff --git a/nvim/lua/m1ngsama/hsl.lua b/home/dot_config/nvim/lua/m1ngsama/hsl.lua
similarity index 65%
rename from nvim/lua/m1ngsama/hsl.lua
rename to home/dot_config/nvim/lua/m1ngsama/hsl.lua
index 4c97404..c97cc06 100644
--- a/nvim/lua/m1ngsama/hsl.lua
+++ b/home/dot_config/nvim/lua/m1ngsama/hsl.lua
@@ -1,20 +1,33 @@
--- https://github.com/EmmanuelOga/columns/blob/master/utils/color.lua
+-- RGB/HSL math adapted from Emmanuel Oga's columns project (CC BY 3.0).
+-- Provenance and local modifications: third_party/hsl-color/UPSTREAM.toml
local M = {}
-local hexChars = "0123456789abcdef"
+local function normalize_hex(hex)
+ if type(hex) ~= "string" then
+ return nil
+ end
-function M.hex_to_rgb(hex)
- hex = string.lower(hex)
- local ret = {}
- for i = 0, 2 do
- local char1 = string.sub(hex, i * 2 + 2, i * 2 + 2)
- local char2 = string.sub(hex, i * 2 + 3, i * 2 + 3)
- local digit1 = string.find(hexChars, char1) - 1
- local digit2 = string.find(hexChars, char2) - 1
- ret[i + 1] = (digit1 * 16 + digit2) / 255.0
+ local digits = hex:match("^#?([%da-fA-F]+)$")
+ if not digits or (#digits ~= 3 and #digits ~= 6) then
+ return nil
+ end
+
+ if #digits == 3 then
+ digits = digits:gsub(".", "%0%0")
end
- return ret
+
+ return digits:lower()
+end
+
+function M.hex_to_rgb(hex)
+ local digits = assert(normalize_hex(hex), "expected a 3- or 6-digit hexadecimal color")
+
+ return {
+ tonumber(digits:sub(1, 2), 16) / 255,
+ tonumber(digits:sub(3, 4), 16) / 255,
+ tonumber(digits:sub(5, 6), 16) / 255,
+ }
end
--[[
@@ -74,29 +87,28 @@ end
]]
function M.hslToRgb(h, s, l)
local r, g, b
+ local function hue2rgb(p, q, t)
+ if t < 0 then
+ t = t + 1
+ end
+ if t > 1 then
+ t = t - 1
+ end
+ if t < 1 / 6 then
+ return p + (q - p) * 6 * t
+ end
+ if t < 1 / 2 then
+ return q
+ end
+ if t < 2 / 3 then
+ return p + (q - p) * (2 / 3 - t) * 6
+ end
+ return p
+ end
if s == 0 then
r, g, b = l, l, l -- achromatic
else
- function hue2rgb(p, q, t)
- if t < 0 then
- t = t + 1
- end
- if t > 1 then
- t = t - 1
- end
- if t < 1 / 6 then
- return p + (q - p) * 6 * t
- end
- if t < 1 / 2 then
- return q
- end
- if t < 2 / 3 then
- return p + (q - p) * (2 / 3 - t) * 6
- end
- return p
- end
-
local q
if l < 0.5 then
q = l * (1 + s)
@@ -114,7 +126,6 @@ function M.hslToRgb(h, s, l)
end
function M.hexToHSL(hex)
- local hsluv = require("solarized-osaka.hsluv")
local rgb = M.hex_to_rgb(hex)
local h, s, l = M.rgbToHsl(rgb[1], rgb[2], rgb[3])
@@ -130,8 +141,22 @@ end
]]
function M.hslToHex(h, s, l)
local r, g, b = M.hslToRgb(h / 360, s / 100, l / 100)
+ local function byte(value)
+ return math.max(0, math.min(255, math.floor(value + 0.5)))
+ end
- return string.format("#%02x%02x%02x", r, g, b)
+ return string.format("#%02x%02x%02x", byte(r), byte(g), byte(b))
+end
+
+function M.replace_hex_colors(line)
+ assert(type(line) == "string", "expected a string")
+
+ return (line:gsub("#([%da-fA-F]+)%f[^%w_]", function(digits)
+ if #digits ~= 3 and #digits ~= 6 then
+ return "#" .. digits
+ end
+ return M.hexToHSL("#" .. digits)
+ end))
end
function M.replaceHexWithHSL()
@@ -141,11 +166,7 @@ function M.replaceHexWithHSL()
-- Get the line content
local line_content = vim.api.nvim_buf_get_lines(0, line_number - 1, line_number, false)[1]
- -- Find hex code patterns and replace them
- for hex in line_content:gmatch("#[0-9a-fA-F]+") do
- local hsl = M.hexToHSL(hex)
- line_content = line_content:gsub(hex, hsl)
- end
+ line_content = M.replace_hex_colors(line_content)
-- Set the line content back
vim.api.nvim_buf_set_lines(0, line_number - 1, line_number, false, { line_content })
diff --git a/home/dot_config/nvim/lua/m1ngsama/lsp.lua b/home/dot_config/nvim/lua/m1ngsama/lsp.lua
new file mode 100644
index 0000000..63c3d11
--- /dev/null
+++ b/home/dot_config/nvim/lua/m1ngsama/lsp.lua
@@ -0,0 +1,8 @@
+local M = {}
+
+function M.toggleInlayHints()
+ local filter = { bufnr = 0 }
+ vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled(filter), filter)
+end
+
+return M
diff --git a/nvim/lua/plugins/coding.lua b/home/dot_config/nvim/lua/plugins/coding.lua
similarity index 100%
rename from nvim/lua/plugins/coding.lua
rename to home/dot_config/nvim/lua/plugins/coding.lua
diff --git a/nvim/lua/plugins/colorscheme.lua b/home/dot_config/nvim/lua/plugins/colorscheme.lua
similarity index 100%
rename from nvim/lua/plugins/colorscheme.lua
rename to home/dot_config/nvim/lua/plugins/colorscheme.lua
diff --git a/nvim/lua/plugins/editor.lua b/home/dot_config/nvim/lua/plugins/editor.lua
similarity index 96%
rename from nvim/lua/plugins/editor.lua
rename to home/dot_config/nvim/lua/plugins/editor.lua
index d8f53dd..1a79325 100644
--- a/nvim/lua/plugins/editor.lua
+++ b/home/dot_config/nvim/lua/plugins/editor.lua
@@ -227,11 +227,4 @@ return {
},
},
- {
- "3rd/image.nvim",
- build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
- opts = {
- processor = "magick_cli",
- },
- },
}
diff --git a/nvim/lua/plugins/lsp.lua b/home/dot_config/nvim/lua/plugins/lsp.lua
similarity index 72%
rename from nvim/lua/plugins/lsp.lua
rename to home/dot_config/nvim/lua/plugins/lsp.lua
index d034c1f..24d51cf 100644
--- a/nvim/lua/plugins/lsp.lua
+++ b/home/dot_config/nvim/lua/plugins/lsp.lua
@@ -1,19 +1,54 @@
+local function extend_unique(target, additions)
+ local seen = {}
+ for _, item in ipairs(target) do
+ seen[item] = true
+ end
+ for _, item in ipairs(additions) do
+ if not seen[item] then
+ table.insert(target, item)
+ seen[item] = true
+ end
+ end
+end
+
+local uname = vim.uv.os_uname()
+local linux_arm64 = uname.sysname == "Linux" and (uname.machine == "aarch64" or uname.machine == "arm64")
+
return {
-- tools
{
"mason-org/mason.nvim",
opts = function(_, opts)
- vim.list_extend(opts.ensure_installed, {
+ -- Pin the registry release as well as the mason.nvim plugin. This fixes
+ -- package recipes and source versions for reproducible cold installs.
+ opts.registries = {
+ "github:mason-org/mason-registry@2026-08-10-faulty-close",
+ }
+ if vim.g.dotfiles_benchmark == 1 then
+ opts.ensure_installed = {}
+ return
+ end
+ opts.ensure_installed = opts.ensure_installed or {}
+ local tools = {
"stylua",
- "selene",
"luacheck",
"shellcheck",
"shfmt",
- "tailwindcss-language-server",
- "typescript-language-server",
- "css-lsp",
- "clangd",
- })
+ }
+ -- This pinned registry release has no Linux arm64 assets for selene or
+ -- clangd. Keep provisioning successful there: luacheck remains
+ -- available and clangd is supplied by the system package manager.
+ if not linux_arm64 then
+ table.insert(tools, "selene")
+ end
+ extend_unique(opts.ensure_installed, tools)
+ end,
+ },
+ {
+ "mfussenegger/nvim-lint",
+ opts = function(_, opts)
+ opts.linters_by_ft = opts.linters_by_ft or {}
+ opts.linters_by_ft.lua = { linux_arm64 and "luacheck" or "selene" }
end,
},
@@ -145,6 +180,7 @@ return {
},
},
clangd = {
+ mason = not linux_arm64,
cmd = { "clangd", "--background-index" },
filetypes = { "c", "cpp", "objc", "objcpp" },
root_dir = function(...)
@@ -177,15 +213,13 @@ return {
end,
},
{
- "iamcco/markdown-preview.nvim",
- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
- ft = { "markdown" },
- build = "cd app && npm install",
- config = function()
- vim.g.mkdp_auto_start = 0
- vim.g.mkdp_auto_close = 1
- vim.g.mkdp_refresh_slow = 0
- vim.g.mkdp_command_for_global = 0
- end,
+ "MeanderingProgrammer/render-markdown.nvim",
+ cmd = { "RenderMarkdown" },
+ ft = { "markdown", "mdx" },
+ dependencies = {
+ "nvim-treesitter/nvim-treesitter",
+ "nvim-mini/mini.icons",
+ },
+ opts = {},
},
}
diff --git a/home/dot_config/nvim/lua/plugins/treesitter.lua b/home/dot_config/nvim/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..009401b
--- /dev/null
+++ b/home/dot_config/nvim/lua/plugins/treesitter.lua
@@ -0,0 +1,54 @@
+local function extend_unique(target, additions)
+ local seen = {}
+ for _, item in ipairs(target) do
+ seen[item] = true
+ end
+ for _, item in ipairs(additions) do
+ if not seen[item] then
+ table.insert(target, item)
+ seen[item] = true
+ end
+ end
+end
+
+return {
+ {
+ "nvim-treesitter/nvim-treesitter",
+ -- LazyVim's build hook and its config hook can both request
+ -- tree-sitter-cli during a cold install. Keep one serialized path: the
+ -- config hook installs the CLI first, then the requested parsers.
+ build = false,
+ init = function()
+ vim.filetype.add({
+ extension = {
+ mdx = "mdx",
+ },
+ })
+ vim.treesitter.language.register("markdown", "mdx")
+ end,
+ opts = function(_, opts)
+ if vim.g.dotfiles_benchmark == 1 then
+ opts.ensure_installed = {}
+ return
+ end
+ opts.ensure_installed = opts.ensure_installed or {}
+ extend_unique(opts.ensure_installed, {
+ "astro",
+ "cmake",
+ "cpp",
+ "css",
+ "fish",
+ "gitignore",
+ "go",
+ "graphql",
+ "http",
+ "java",
+ "php",
+ "rust",
+ "scss",
+ "sql",
+ "svelte",
+ })
+ end,
+ },
+}
diff --git a/nvim/lua/plugins/ui.lua b/home/dot_config/nvim/lua/plugins/ui.lua
similarity index 100%
rename from nvim/lua/plugins/ui.lua
rename to home/dot_config/nvim/lua/plugins/ui.lua
diff --git a/nvim/lua/util/debug.lua b/home/dot_config/nvim/lua/util/debug.lua
similarity index 100%
rename from nvim/lua/util/debug.lua
rename to home/dot_config/nvim/lua/util/debug.lua
diff --git a/home/dot_config/picom/picom.conf b/home/dot_config/picom/picom.conf
new file mode 100644
index 0000000..d260b97
--- /dev/null
+++ b/home/dot_config/picom/picom.conf
@@ -0,0 +1,8 @@
+# Picom only composites windows. Application-specific whole-window opacity is
+# deliberately disabled so terminal text stays opaque; Alacritty controls its
+# own background transparency.
+active-opacity = 1.0;
+
+inactive-opacity = 1.0;
+
+frame-opacity = 1.0;
diff --git a/ranger/scope.sh b/home/dot_config/ranger/executable_scope.sh
similarity index 71%
rename from ranger/scope.sh
rename to home/dot_config/ranger/executable_scope.sh
index 11508f9..140aa9d 100755
--- a/ranger/scope.sh
+++ b/home/dot_config/ranger/executable_scope.sh
@@ -30,7 +30,6 @@ IFS=$'\n'
## Script arguments
FILE_PATH="${1}" # Full path of the highlighted file
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
-## shellcheck disable=SC2034 # PV_HEIGHT is provided for convenience and unused
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
@@ -46,6 +45,39 @@ HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYL
PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn}
OPENSCAD_IMGSIZE=${RNGR_OPENSCAD_IMGSIZE:-1000,1000}
OPENSCAD_COLORSCHEME=${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night}
+SCOPE_TEMP_PARENT=
+SCOPE_TEMP_DIR=
+
+scope_cleanup_temp() {
+ [[ -n ${SCOPE_TEMP_DIR} && -n ${SCOPE_TEMP_PARENT} ]] || return 0
+ case ${SCOPE_TEMP_DIR} in
+ "${SCOPE_TEMP_PARENT}"/ranger-font-preview.*)
+ rm -rf -- "${SCOPE_TEMP_DIR}"
+ ;;
+ esac
+}
+trap scope_cleanup_temp EXIT
+trap 'exit 1' HUP INT TERM
+
+scope_create_font_temp() {
+ local requested_parent=${TMPDIR:-/tmp}
+
+ [[ -d ${requested_parent} ]] || return 1
+ SCOPE_TEMP_PARENT=$(cd -P -- "${requested_parent}" && pwd -P) || return 1
+ SCOPE_TEMP_DIR=$(mktemp -d "${SCOPE_TEMP_PARENT}/ranger-font-preview.XXXXXXXX") || return 1
+}
+
+scope_file_size() {
+ ## GNU and BSD/macOS stat use different flags. Keep preview errors out of
+ ## ranger while retaining compatibility with both Tier-1 platforms.
+ stat -c '%s' -- "$1" 2>/dev/null || stat -f '%z' -- "$1"
+}
+
+scope_chafa_preview() {
+ command -v chafa >/dev/null 2>&1 || return 1
+ chafa --animate=off --size="${PV_WIDTH}x${PV_HEIGHT}" \
+ --symbols=block -- "$1"
+}
handle_extension() {
case "${FILE_EXTENSION_LOWER}" in
@@ -70,12 +102,24 @@ handle_extension() {
## PDF
pdf)
## Preview as text conversion
- pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - |
- fmt -w "${PV_WIDTH}" && exit 5
- mutool draw -F txt -i -- "${FILE_PATH}" 1-10 |
- fmt -w "${PV_WIDTH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
- exit 1
+ if command -v pdftotext >/dev/null 2>&1; then
+ pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - |
+ fmt -w "${PV_WIDTH}" && exit 5
+ fi
+ if command -v mutool >/dev/null 2>&1; then
+ mutool draw -F txt -i -- "${FILE_PATH}" 1-10 |
+ fmt -w "${PV_WIDTH}" && exit 5
+ fi
+ if command -v pdftoppm >/dev/null 2>&1; then
+ pdftoppm -f 1 -l 1 -scale-to-x 1920 -scale-to-y -1 \
+ -singlefile -jpeg -tiffcompression jpeg -- \
+ "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" &&
+ scope_chafa_preview "${IMAGE_CACHE_PATH}" && exit 4
+ fi
+ if command -v exiftool >/dev/null 2>&1; then
+ exiftool "${FILE_PATH}" && exit 5
+ fi
+ return
;;
## BitTorrent
@@ -119,8 +163,12 @@ handle_extension() {
## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
## by file(1).
dff | dsf | wv | wvc)
- mediainfo "${FILE_PATH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
+ if command -v mediainfo >/dev/null 2>&1; then
+ mediainfo "${FILE_PATH}" && exit 5
+ fi
+ if command -v exiftool >/dev/null 2>&1; then
+ exiftool "${FILE_PATH}" && exit 5
+ fi
;; # Continue with next handler on failure
esac
}
@@ -147,13 +195,16 @@ handle_image() {
## Image
image/*)
- local orientation
- orientation="$(identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}")"
- ## If orientation data is present and the image actually
- ## needs rotating ("1" means no rotation)...
- if [[ -n "$orientation" && "$orientation" != 1 ]]; then
- ## ...auto-rotate the image according to the EXIF data.
- convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
+ if command -v identify >/dev/null 2>&1 && command -v convert >/dev/null 2>&1; then
+ local orientation
+ orientation="$(identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" 2>/dev/null)" ||
+ orientation=
+ ## If orientation data is present and the image actually
+ ## needs rotating ("1" means no rotation)...
+ if [[ -n "$orientation" && "$orientation" != 1 ]]; then
+ ## ...auto-rotate the image according to the EXIF data.
+ convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
+ fi
fi
## `w3mimgdisplay` will be called for all images (unless overriden
@@ -162,20 +213,23 @@ handle_image() {
;;
## Video
- # video/*)
- # # Thumbnail
- # ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
- # exit 1;;
+ video/*)
+ if command -v ffmpegthumbnailer >/dev/null 2>&1; then
+ ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
+ fi
+ ;;
## PDF
- # application/pdf)
- # pdftoppm -f 1 -l 1 \
- # -scale-to-x "${DEFAULT_SIZE%x*}" \
- # -scale-to-y -1 \
- # -singlefile \
- # -jpeg -tiffcompression jpeg \
- # -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
- # && exit 6 || exit 1;;
+ application/pdf)
+ if command -v pdftoppm >/dev/null 2>&1; then
+ pdftoppm -f 1 -l 1 \
+ -scale-to-x "${DEFAULT_SIZE%x*}" \
+ -scale-to-y -1 \
+ -singlefile \
+ -jpeg -tiffcompression jpeg \
+ -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" && exit 6
+ fi
+ ;;
## ePub, MOBI, FB2 (using Calibre)
# application/epub+zip|application/x-mobipocket-ebook|\
@@ -189,7 +243,10 @@ handle_image() {
## Font
application/font* | application/*opentype)
- preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png"
+ command -v fontimage >/dev/null 2>&1 || return
+ command -v convert >/dev/null 2>&1 || return
+ scope_create_font_temp || exit 1
+ preview_png="${SCOPE_TEMP_DIR}/preview.png"
if fontimage -o "${preview_png}" \
--pixelsize "120" \
--fontname \
@@ -199,9 +256,7 @@ handle_image() {
--text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \
--text " The quick brown fox jumps over the lazy dog. " \
"${FILE_PATH}"; then
- convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" &&
- rm "${preview_png}" &&
- exit 6
+ convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" && exit 6
else
exit 1
fi
@@ -301,7 +356,9 @@ handle_mime() {
## Text
text/* | */xml | application/javascript)
## Syntax highlight
- if [[ "$(stat --printf='%s' -- "${FILE_PATH}")" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
+ local file_size
+ file_size=$(scope_file_size "${FILE_PATH}") || exit 2
+ if [[ "${file_size}" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
exit 2
fi
if [[ "$(tput colors)" -ge 256 ]]; then
@@ -324,24 +381,43 @@ handle_mime() {
## DjVu
image/vnd.djvu)
## Preview as text conversion (requires djvulibre)
- djvutxt "${FILE_PATH}" | fmt -w "${PV_WIDTH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
- exit 1
+ if command -v djvutxt >/dev/null 2>&1; then
+ djvutxt "${FILE_PATH}" | fmt -w "${PV_WIDTH}" && exit 5
+ fi
+ if command -v exiftool >/dev/null 2>&1; then
+ exiftool "${FILE_PATH}" && exit 5
+ fi
;;
## Image
image/*)
## Preview as text conversion
- # img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
- exiftool "${FILE_PATH}" && exit 5
- exit 1
+ scope_chafa_preview "${FILE_PATH}" && exit 4
+ if command -v exiftool >/dev/null 2>&1; then
+ exiftool "${FILE_PATH}" && exit 5
+ fi
;;
## Video and audio
- video/* | audio/*)
- mediainfo "${FILE_PATH}" && exit 5
- exiftool "${FILE_PATH}" && exit 5
- exit 1
+ video/*)
+ if command -v ffmpegthumbnailer >/dev/null 2>&1; then
+ ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 &&
+ scope_chafa_preview "${IMAGE_CACHE_PATH}" && exit 4
+ fi
+ if command -v mediainfo >/dev/null 2>&1; then
+ mediainfo "${FILE_PATH}" && exit 5
+ fi
+ if command -v exiftool >/dev/null 2>&1; then
+ exiftool "${FILE_PATH}" && exit 5
+ fi
+ ;;
+ audio/*)
+ if command -v mediainfo >/dev/null 2>&1; then
+ mediainfo "${FILE_PATH}" && exit 5
+ fi
+ if command -v exiftool >/dev/null 2>&1; then
+ exiftool "${FILE_PATH}" && exit 5
+ fi
;;
esac
}
diff --git a/home/dot_config/ranger/rc.conf b/home/dot_config/ranger/rc.conf
new file mode 100644
index 0000000..ba47d31
--- /dev/null
+++ b/home/dot_config/ranger/rc.conf
@@ -0,0 +1,13 @@
+# Small overrides on top of ranger's packaged defaults.
+set use_preview_script true
+set preview_script ~/.config/ranger/scope.sh
+
+set vcs_aware true
+set preview_images false
+set collapse_preview false
+set wrap_plaintext_previews true
+set draw_borders both
+
+# Chafa is the portable default; graphical image methods remain terminal-local.
+# Ranger keeps its built-in dT trash binding, while uT restores trashed files.
+map uT shell -w if command -v trash-restore >/dev/null 2>&1; then trash-restore; else printf 'trash-restore is unavailable\n' >&2; fi
diff --git a/tmux/macos.conf b/home/dot_config/tmux/macos.conf
similarity index 100%
rename from tmux/macos.conf
rename to home/dot_config/tmux/macos.conf
diff --git a/home/dot_config/tmux/theme.conf b/home/dot_config/tmux/theme.conf
new file mode 100644
index 0000000..0933d50
--- /dev/null
+++ b/home/dot_config/tmux/theme.conf
@@ -0,0 +1,35 @@
+# Solarized Osaka palette from the repository's locked solarized-osaka.nvim
+# commit f796014c14b1910e08d42cc2077fef34f08e0295. Red is reserved for bells.
+
+set-option -g mode-style 'fg=#001419,bg=#29a298,bold'
+set-option -g message-style 'fg=#ede7d3,bg=#002c38'
+set-option -g message-command-style 'fg=#001419,bg=#b28500,bold'
+
+set-option -g pane-border-style 'fg=#002c38,bg=default'
+set-option -g pane-active-border-style 'fg=#268bd3,bg=default'
+set-window-option -g window-style default
+set-window-option -g window-active-style default
+
+set-option -g display-panes-active-colour '#268bd3'
+set-option -g display-panes-colour '#9eabac'
+set-window-option -g clock-mode-colour '#849900'
+
+set-option -g status on
+set-option -g status-interval 5
+set-option -g status-justify left
+set-option -g status-style 'fg=#9eabac,bg=#001419'
+set-option -g status-left-length 100
+set-option -g status-right-length 100
+set-option -g status-left-style default
+set-option -g status-right-style default
+
+set-option -g status-left '#[fg=#001419,bg=#b28500,bold] #S #[fg=#b28500,bg=#002c38,nobold]#[fg=#9eabac,bg=#002c38] #{USER} #[fg=#002c38,bg=#001419]'
+set-option -g status-right '#[fg=#002c38,bg=#001419]#[fg=#9eabac,bg=#002c38,bold] #h '
+
+set-window-option -g window-status-separator ''
+set-window-option -g window-status-style 'fg=#839395,bg=#001419'
+set-window-option -g window-status-current-style 'fg=#001419,bg=#268bd3,bold'
+set-window-option -g window-status-activity-style 'fg=#29a298,bg=#001419,underscore'
+set-window-option -g window-status-bell-style 'fg=#ffffff,bg=#db302d,bold'
+set-window-option -g window-status-format ' #I #{b:pane_current_path} '
+set-window-option -g window-status-current-format ' #I #{b:pane_current_path} '
diff --git a/home/dot_config/tmux/tmux.conf b/home/dot_config/tmux/tmux.conf
new file mode 100644
index 0000000..15c7d44
--- /dev/null
+++ b/home/dot_config/tmux/tmux.conf
@@ -0,0 +1,60 @@
+# Requires tmux 3.2+ (`display-popup`, `source-file -F`, and `current_file`).
+# Prefer tmux's own terminfo entry while retaining a safe minimal fallback.
+if-shell 'infocmp tmux-256color >/dev/null 2>&1' \
+ 'set-option -g default-terminal tmux-256color' \
+ 'set-option -g default-terminal screen-256color'
+
+# Rebuild terminal capabilities on every reload so append operations remain
+# idempotent. The macOS fragment adds its capabilities after this reset.
+set-option -gu terminal-features
+set-option -gu terminal-overrides
+set-option -as terminal-features ',alacritty:RGB,xterm*:RGB'
+set-option -as terminal-overrides ',alacritty:Tc,*256col*:Tc'
+
+# Remember the file that was actually sourced. This keeps reload and adjacent
+# fragments independent of $HOME and $XDG_CONFIG_HOME.
+set-option -gF @dotfiles_config_file '#{current_file}'
+
+#### Prefix and key bindings
+
+unbind -q C-b
+set-option -g prefix C-t
+set-option -g repeat-time 500
+set-option -g focus-events on
+set-window-option -g mode-keys vi
+
+bind r source-file -F '#{@dotfiles_config_file}' \; display-message 'Reloaded #{@dotfiles_config_file}'
+
+# Open the current directory with the platform's standard desktop opener.
+bind o run-shell 'if command -v open >/dev/null 2>&1; then open #{q:pane_current_path}; elif command -v xdg-open >/dev/null 2>&1; then xdg-open #{q:pane_current_path}; else tmux display-message "No directory opener found (open/xdg-open)"; fi'
+bind -r e kill-pane -a
+
+# Pane navigation and resizing.
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+bind -r H resize-pane -L 5
+bind -r J resize-pane -D 3
+bind -r K resize-pane -U 3
+bind -r L resize-pane -R 5
+
+# Pane and window lifecycle.
+bind | split-window -h
+bind - split-window -v
+bind x kill-pane
+bind X kill-window
+
+#### Core behavior
+
+set-option -g history-limit 64096
+set-option -sg escape-time 10
+set-option -g set-titles on
+set-option -g set-titles-string '#T'
+
+# Load only adjacent fragments. macOS behavior remains conditional and does
+# not affect Linux or other Unix hosts.
+if-shell 'test "$(uname -s)" = Darwin' 'source-file -F "#{d:current_file}/macos.conf"'
+source-file -F '#{d:current_file}/theme.conf'
+source-file -F '#{d:current_file}/utility.conf'
diff --git a/home/dot_config/tmux/utility.conf b/home/dot_config/tmux/utility.conf
new file mode 100644
index 0000000..1b0de06
--- /dev/null
+++ b/home/dot_config/tmux/utility.conf
@@ -0,0 +1,6 @@
+# Open lazygit in the current pane's directory when available. A missing
+# optional dependency produces an actionable tmux message instead of a failed
+# popup or a shell error.
+bind -r g if-shell 'command -v lazygit >/dev/null 2>&1' \
+ 'display-popup -d "#{pane_current_path}" -w 80% -h 80% -E lazygit' \
+ 'display-message "lazygit is not installed; install it to enable prefix + g"'
diff --git a/home/dot_xprofile b/home/dot_xprofile
new file mode 100644
index 0000000..408710a
--- /dev/null
+++ b/home/dot_xprofile
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if command -v xmodmap >/dev/null 2>&1 && [ -r "$HOME/.Xmodmap" ]; then
+ xmodmap "$HOME/.Xmodmap"
+fi
diff --git a/home/executable_dot_xinitrc b/home/executable_dot_xinitrc
new file mode 100644
index 0000000..7e43c94
--- /dev/null
+++ b/home/executable_dot_xinitrc
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+export XDG_SESSION_TYPE=x11
+
+# Display managers usually source .xprofile themselves; startx does not do so
+# consistently. Source the managed profile here to keep both entry paths
+# equivalent, then load the managed X resources when xrdb is available.
+if [ -r "$HOME/.xprofile" ]; then
+ # shellcheck disable=SC1090,SC1091
+ . "$HOME/.xprofile"
+fi
+
+if command -v xrdb >/dev/null 2>&1 && [ -r "$HOME/.Xresources" ]; then
+ xrdb -merge "$HOME/.Xresources"
+fi
+
+exec i3
diff --git a/i3/.Xresources b/i3/.Xresources
deleted file mode 100644
index 7a4f74f..0000000
--- a/i3/.Xresources
+++ /dev/null
@@ -1,2 +0,0 @@
-URxvt.font: xft:JetBrains Mono Nerd:size=12
-
diff --git a/i3/.xinitrc b/i3/.xinitrc
deleted file mode 100644
index 2954877..0000000
--- a/i3/.xinitrc
+++ /dev/null
@@ -1,4 +0,0 @@
-exec i3
-
-export XDG_SESSION_TYPE=x11
-
diff --git a/i3/.xprofile b/i3/.xprofile
deleted file mode 100644
index 95dfbde..0000000
--- a/i3/.xprofile
+++ /dev/null
@@ -1 +0,0 @@
-xmodmap -e 'clear lock' -e 'keycode 66 = Control_L' -e 'add control = Control_L'
diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json
deleted file mode 100644
index 3bbffe7..0000000
--- a/nvim/lazyvim.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extras": [
-
- ],
- "install_version": 8,
- "news": {
- "NEWS.md": "11866",
- "doc/news.txt": "25358"
- },
- "version": 8
-}
\ No newline at end of file
diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua
deleted file mode 100644
index ef0710c..0000000
--- a/nvim/lua/config/lazy.lua
+++ /dev/null
@@ -1,87 +0,0 @@
-local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
-if not vim.loop.fs_stat(lazypath) then
- vim.fn.system({
- "git",
- "clone",
- "--filter=blob:none",
- "https://github.com/folke/lazy.nvim.git",
- "--branch=stable", -- latest stable release
- lazypath,
- })
-end
-vim.opt.rtp:prepend(lazypath)
-
-require("lazy").setup({
- spec = {
- -- add LazyVim and import its plugins
- {
- "LazyVim/LazyVim",
- import = "lazyvim.plugins",
- opts = {
- colorscheme = "solarized-osaka",
- news = {
- lazyvim = true,
- neovim = true,
- },
- },
- },
- -- import any extras modules here
- { import = "lazyvim.plugins.extras.linting.eslint" },
- { import = "lazyvim.plugins.extras.formatting.prettier" },
- { import = "lazyvim.plugins.extras.lang.typescript" },
- { import = "lazyvim.plugins.extras.lang.json" },
- -- { import = "lazyvim.plugins.extras.lang.markdown" },
- { import = "lazyvim.plugins.extras.lang.rust" },
- { import = "lazyvim.plugins.extras.lang.tailwind" },
- -- { import = "lazyvim.plugins.extras.ai.copilot" },
- -- { import = "lazyvim.plugins.extras.dap.core" },
- -- { import = "lazyvim.plugins.extras.vscode" },
- { import = "lazyvim.plugins.extras.util.mini-hipatterns" },
- -- { import = "lazyvim.plugins.extras.test.core" },
- -- { import = "lazyvim.plugins.extras.coding.yanky" },
- -- { import = "lazyvim.plugins.extras.editor.mini-files" },
- -- { import = "lazyvim.plugins.extras.util.project" },
- { import = "plugins" },
- },
- defaults = {
- -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
- -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
- lazy = false,
- -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
- -- have outdated releases, which may break your Neovim install.
- version = false, -- always use the latest git commit
- -- version = "*", -- try installing the latest stable version for plugins that support semver
- },
- dev = {
- path = "~/.ghq/github.com",
- },
- checker = { enabled = true }, -- automatically check for plugin updates
- performance = {
- cache = {
- enabled = true,
- -- disable_events = {},
- },
- rtp = {
- -- disable some rtp plugins
- disabled_plugins = {
- "gzip",
- -- "matchit",
- "matchparen", -- using vim-matchup or other alternatives
- "netrwPlugin",
- "rplugin",
- "tarPlugin",
- "tohtml",
- "tutor",
- "zipPlugin",
- },
- },
- },
- ui = {
- custom_keys = {
- ["d"] = function(plugin)
- dd(plugin)
- end,
- },
- },
- debug = false,
-})
diff --git a/nvim/lua/m1ngsama/lsp.lua b/nvim/lua/m1ngsama/lsp.lua
deleted file mode 100644
index a52e945..0000000
--- a/nvim/lua/m1ngsama/lsp.lua
+++ /dev/null
@@ -1,7 +0,0 @@
-local M = {}
-
-function M.toggleInlayHints()
- vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled())
-end
-
-return M
diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua
deleted file mode 100644
index f3443d2..0000000
--- a/nvim/lua/plugins/treesitter.lua
+++ /dev/null
@@ -1,67 +0,0 @@
-return {
- { "nvim-treesitter/playground", cmd = "TSPlaygroundToggle" },
-
- {
- "nvim-treesitter/nvim-treesitter",
- opts = {
- ensure_installed = {
- "astro",
- "cmake",
- "cpp",
- "css",
- "fish",
- "gitignore",
- "go",
- "graphql",
- "http",
- "java",
- "php",
- "rust",
- "scss",
- "sql",
- "svelte",
- },
-
- -- matchup = {
- -- enable = true,
- -- },
-
- -- https://github.com/nvim-treesitter/playground#query-linter
- query_linter = {
- enable = true,
- use_virtual_text = true,
- lint_events = { "BufWrite", "CursorHold" },
- },
-
- playground = {
- enable = true,
- disable = {},
- updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
- persist_queries = true, -- Whether the query persists across vim sessions
- keybindings = {
- toggle_query_editor = "o",
- toggle_hl_groups = "i",
- toggle_injected_languages = "t",
- toggle_anonymous_nodes = "a",
- toggle_language_display = "I",
- focus_language = "f",
- unfocus_language = "F",
- update = "R",
- goto_node = "",
- show_help = "?",
- },
- },
- },
- config = function(_, opts)
- require("nvim-treesitter.configs").setup(opts)
-
- -- MDX
- vim.filetype.add({
- extension = {
- mdx = "mdx",
- },
- })
- vim.treesitter.language.register("markdown", "mdx")
- end,
- },
-}
diff --git a/picom/picom.conf b/picom/picom.conf
deleted file mode 100644
index 46ae2ae..0000000
--- a/picom/picom.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# Default opacity of active windows.
-active-opacity = 1.0;
-
-# Default opacity of inactive windows.
-inactive-opacity = 1.0;
-
-# Opacity of window titlebars and borders.
-frame-opacity = 1.0;
-
-# Application-specific settings; these override the default `active-opacity`
-opacity-rule = [
- "95:class_g = 'Alacritty' && focused",
- "80:class_g = 'Alacritty' && !focused"
-];
diff --git a/scripts/backup b/scripts/backup
new file mode 100755
index 0000000..94c3760
--- /dev/null
+++ b/scripts/backup
@@ -0,0 +1,191 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+umask 077
+
+script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
+# shellcheck disable=SC1091
+source "$script_dir/lib/safety.bash"
+
+backup_destination=${HOME:-}
+backup_paths_file=
+backup_directories_file=
+backup_output_parent=
+backup_dir=
+
+usage() {
+ cat <<'EOF'
+Usage: scripts/backup --paths-file FILE [--directories-file FILE]
+ [--destination DIR] [--output-parent DIR]
+
+Back up the existing regular files and symlinks named in FILE. FILE must
+contain one validated destination-relative path per line. The resulting
+manifest also records paths that did not exist, enabling an explicit restore
+to distinguish pre-existing files from files later created by chezmoi.
+--directories-file records whether managed directories existed and preserves
+their permission mode without copying their contents.
+EOF
+}
+
+cleanup_failed_backup() {
+ if [[ -n $backup_dir && -n $backup_output_parent ]]; then
+ dotfiles_safe_cleanup_tree "$backup_dir" "$backup_output_parent" backup-
+ backup_dir=
+ fi
+}
+
+exit_for_signal() {
+ local status=$1
+
+ trap - HUP INT TERM
+ cleanup_failed_backup || true
+ trap - EXIT
+ exit "$status"
+}
+
+trap cleanup_failed_backup EXIT
+trap 'exit_for_signal 129' HUP
+trap 'exit_for_signal 130' INT
+trap 'exit_for_signal 143' TERM
+
+while (($# > 0)); do
+ case $1 in
+ --destination)
+ (($# >= 2)) || dotfiles_die '--destination requires an argument'
+ backup_destination=$2
+ shift 2
+ ;;
+ --destination=*)
+ backup_destination=${1#*=}
+ shift
+ ;;
+ --paths-file)
+ (($# >= 2)) || dotfiles_die '--paths-file requires an argument'
+ backup_paths_file=$2
+ shift 2
+ ;;
+ --paths-file=*)
+ backup_paths_file=${1#*=}
+ shift
+ ;;
+ --directories-file)
+ (($# >= 2)) || dotfiles_die '--directories-file requires an argument'
+ backup_directories_file=$2
+ shift 2
+ ;;
+ --directories-file=*)
+ backup_directories_file=${1#*=}
+ shift
+ ;;
+ --output-parent)
+ (($# >= 2)) || dotfiles_die '--output-parent requires an argument'
+ backup_output_parent=$2
+ shift 2
+ ;;
+ --output-parent=*)
+ backup_output_parent=${1#*=}
+ shift
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ *)
+ dotfiles_die "unknown argument: $1"
+ ;;
+ esac
+done
+
+[[ -n $backup_destination ]] || dotfiles_die 'HOME is unset; pass --destination explicitly'
+[[ -n $backup_paths_file ]] || dotfiles_die '--paths-file is required'
+dotfiles_validate_absolute_path "$backup_paths_file" 'paths file'
+[[ -f $backup_paths_file && ! -L $backup_paths_file ]] ||
+ dotfiles_die "paths file must be a regular, non-symlink file: $backup_paths_file"
+if [[ -n $backup_directories_file ]]; then
+ dotfiles_validate_absolute_path "$backup_directories_file" 'directories file'
+ [[ -f $backup_directories_file && ! -L $backup_directories_file ]] ||
+ dotfiles_die "directories file must be a regular, non-symlink file: $backup_directories_file"
+fi
+
+backup_destination=$(dotfiles_prepare_directory "$backup_destination" 'destination')
+if [[ -z $backup_output_parent ]]; then
+ backup_output_parent="$backup_destination/.local/state/dotfiles/backups"
+fi
+backup_output_parent=$(dotfiles_prepare_directory "$backup_output_parent" 'backup parent')
+
+duplicate_path=$(LC_ALL=C sort "$backup_paths_file" | uniq -d | head -n 1 || true)
+[[ -z $duplicate_path ]] || dotfiles_die "duplicate managed path: $duplicate_path"
+if [[ -n $backup_directories_file ]]; then
+ duplicate_path=$(LC_ALL=C sort "$backup_directories_file" | uniq -d | head -n 1 || true)
+ [[ -z $duplicate_path ]] || dotfiles_die "duplicate managed directory: $duplicate_path"
+fi
+
+backup_timestamp=$(date -u +%Y%m%dT%H%M%SZ)
+backup_dir=$(mktemp -d "$backup_output_parent/backup-$backup_timestamp.XXXXXXXX")
+mkdir -p -- "$backup_dir/files"
+backup_manifest="$backup_dir/manifest.tsv"
+backup_metadata="$backup_dir/metadata"
+: >"$backup_manifest"
+{
+ printf 'format=2\n'
+ printf 'destination=%s\n' "$backup_destination"
+ printf 'created_utc=%s\n' "$backup_timestamp"
+} >"$backup_metadata"
+
+backup_count=0
+absent_count=0
+directory_count=0
+absent_directory_count=0
+while IFS= read -r managed_path || [[ -n $managed_path ]]; do
+ dotfiles_validate_relative_path "$managed_path"
+ dotfiles_assert_safe_parent_chain "$backup_destination" "$managed_path"
+ destination_target="$backup_destination/$managed_path"
+
+ if [[ -e $destination_target || -L $destination_target ]]; then
+ if [[ ! -f $destination_target && ! -L $destination_target ]]; then
+ dotfiles_die "managed file target has an unsupported type: $destination_target"
+ fi
+ backup_target="$backup_dir/files/$managed_path"
+ mkdir -p -- "$(dirname -- "$backup_target")"
+ cp -pPR -- "$destination_target" "$backup_target"
+ printf 'present\t%s\n' "$managed_path" >>"$backup_manifest"
+ backup_count=$((backup_count + 1))
+ else
+ printf 'absent\t%s\n' "$managed_path" >>"$backup_manifest"
+ absent_count=$((absent_count + 1))
+ fi
+done <"$backup_paths_file"
+
+if [[ -n $backup_directories_file ]]; then
+ while IFS= read -r managed_path || [[ -n $managed_path ]]; do
+ dotfiles_validate_relative_path "$managed_path"
+ dotfiles_assert_safe_parent_chain "$backup_destination" "$managed_path"
+ destination_target="$backup_destination/$managed_path"
+
+ if [[ -L $destination_target ]]; then
+ dotfiles_die "managed directory target is a symlink; refusing to traverse it: $destination_target"
+ elif [[ -e $destination_target ]]; then
+ [[ -d $destination_target ]] ||
+ dotfiles_die "managed directory target has an unsupported type: $destination_target"
+ if directory_mode=$(stat -c '%a' -- "$destination_target" 2>/dev/null); then
+ :
+ elif directory_mode=$(stat -f '%Lp' -- "$destination_target" 2>/dev/null); then
+ :
+ else
+ dotfiles_die "could not read directory mode: $destination_target"
+ fi
+ [[ $directory_mode =~ ^[0-7]{3,4}$ ]] ||
+ dotfiles_die "invalid directory mode for $destination_target: $directory_mode"
+ printf 'directory\t%s\t%s\n' "$managed_path" "$directory_mode" >>"$backup_manifest"
+ directory_count=$((directory_count + 1))
+ else
+ printf 'absent-directory\t%s\n' "$managed_path" >>"$backup_manifest"
+ absent_directory_count=$((absent_directory_count + 1))
+ fi
+ done <"$backup_directories_file"
+fi
+
+printf 'Backed up %d existing file/symlink target(s) and %d directory mode(s); recorded %d absent file/symlink target(s) and %d absent directories.\n' \
+ "$backup_count" "$directory_count" "$absent_count" "$absent_directory_count" >&2
+printf '%s\n' "$backup_dir"
+backup_dir=
diff --git a/scripts/benchmark b/scripts/benchmark
new file mode 100755
index 0000000..371cde0
--- /dev/null
+++ b/scripts/benchmark
@@ -0,0 +1,702 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+umask 077
+
+repo_root=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)
+# shellcheck disable=SC1091
+source "$repo_root/scripts/lib/safety.bash"
+
+samples=100
+nvim_samples=30
+warmups=5
+nvim_data=
+benchmark_root=
+benchmark_parent=
+
+usage() {
+ cat <<'EOF'
+Usage: scripts/benchmark [OPTIONS]
+
+Run startup benchmarks in a temporary HOME and XDG environment.
+
+Options:
+ --samples COUNT Fish and prompt samples (default: 100)
+ --warmups COUNT Untimed warm-up iterations (default: 5)
+ --nvim-data DIR Already-provisioned Neovim stdpath("data") directory
+ --nvim-samples COUNT Warm Neovim samples (default: 30)
+ -h, --help Show this help
+
+Neovim is skipped unless --nvim-data names a dedicated, already-provisioned
+data directory. The directory is copied before use and is never modified.
+Neovim benchmark mode disables dependency provisioning. Configured Fish keeps
+installed optional host integrations as explicit benchmark inputs. Results are
+observations; this command does not enforce pass/fail budgets.
+EOF
+}
+
+cleanup() {
+ if [[ -n $benchmark_root && -n $benchmark_parent ]]; then
+ dotfiles_safe_cleanup_tree "$benchmark_root" "$benchmark_parent" dotfiles-benchmark.
+ benchmark_root=
+ fi
+}
+
+trap cleanup EXIT
+trap 'exit 129' HUP
+trap 'exit 130' INT
+trap 'exit 143' TERM
+
+while (($# > 0)); do
+ case $1 in
+ --samples)
+ (($# >= 2)) || dotfiles_die '--samples requires an argument'
+ samples=$2
+ shift 2
+ ;;
+ --samples=*)
+ samples=${1#*=}
+ shift
+ ;;
+ --warmups)
+ (($# >= 2)) || dotfiles_die '--warmups requires an argument'
+ warmups=$2
+ shift 2
+ ;;
+ --warmups=*)
+ warmups=${1#*=}
+ shift
+ ;;
+ --nvim-data)
+ (($# >= 2)) || dotfiles_die '--nvim-data requires an argument'
+ nvim_data=$2
+ shift 2
+ ;;
+ --nvim-data=*)
+ nvim_data=${1#*=}
+ shift
+ ;;
+ --nvim-samples)
+ (($# >= 2)) || dotfiles_die '--nvim-samples requires an argument'
+ nvim_samples=$2
+ shift 2
+ ;;
+ --nvim-samples=*)
+ nvim_samples=${1#*=}
+ shift
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ *)
+ dotfiles_die "unknown argument: $1"
+ ;;
+ esac
+done
+
+[[ $samples =~ ^[1-9][0-9]*$ ]] || dotfiles_die '--samples must be a positive integer'
+[[ $warmups =~ ^[0-9]+$ ]] || dotfiles_die '--warmups must be a non-negative integer'
+[[ $nvim_samples =~ ^[1-9][0-9]*$ ]] || dotfiles_die '--nvim-samples must be a positive integer'
+
+find_executable() {
+ local executable
+
+ executable=$(type -P "$1" 2>/dev/null || true)
+ [[ -n $executable && $executable == /* && -x $executable ]] ||
+ dotfiles_die "$1 is required"
+ printf '%s\n' "$executable"
+}
+
+python_bin=$(find_executable python3)
+fish_bin=$(find_executable fish)
+git_bin=$(find_executable git)
+uname_bin=$(find_executable uname)
+nvim_bin=$(type -P nvim 2>/dev/null || true)
+if [[ -n $nvim_bin && ($nvim_bin != /* || ! -x $nvim_bin) ]]; then
+ nvim_bin=
+fi
+
+benchmark_parent=${TMPDIR:-/tmp}
+[[ -d $benchmark_parent ]] || dotfiles_die "temporary parent does not exist: $benchmark_parent"
+benchmark_parent=$(cd -P -- "$benchmark_parent" && pwd -P)
+dotfiles_validate_absolute_path "$benchmark_parent" 'temporary parent'
+benchmark_root=$(mktemp -d "$benchmark_parent/dotfiles-benchmark.XXXXXXXX")
+
+benchmark_home="$benchmark_root/home"
+xdg_config="$benchmark_root/xdg/config"
+xdg_data="$benchmark_root/xdg/data"
+xdg_state="$benchmark_root/xdg/state"
+xdg_cache="$benchmark_root/xdg/cache"
+runtime_bin="$benchmark_root/bin"
+nvim_runtime_bin="$benchmark_root/nvim-bin"
+outside_git="$benchmark_root/outside-git"
+git_fixture="$benchmark_root/git-fixture"
+large_git_fixture="$benchmark_root/large-git-fixture"
+git_template="$benchmark_root/git-template"
+
+mkdir -p -- \
+ "$benchmark_home" \
+ "$xdg_config/fish" \
+ "$xdg_data" \
+ "$xdg_state" \
+ "$xdg_cache" \
+ "$runtime_bin" \
+ "$nvim_runtime_bin" \
+ "$outside_git" \
+ "$git_template"
+cp -pPR -- "$repo_root/home/dot_config/fish/." "$xdg_config/fish/"
+
+ln -s -- "$fish_bin" "$runtime_bin/fish"
+ln -s -- "$git_bin" "$runtime_bin/git"
+ln -s -- "$uname_bin" "$runtime_bin/uname"
+# conf.d integrations run before config.fish adds standard package-manager
+# paths. Seed only those existing, declared host paths so the configured Fish
+# measurement and its reported optional integrations describe the same startup.
+benchmark_path=$runtime_bin
+for host_path in \
+ /opt/homebrew/bin \
+ /opt/homebrew/sbin \
+ /usr/local/bin \
+ /usr/local/sbin \
+ /usr/local/mysql/bin; do
+ if [[ -d $host_path ]]; then
+ benchmark_path="$benchmark_path:$host_path"
+ fi
+done
+# Neovim may validate the configured shell, but omitting Git and download tools
+# ensures an incomplete plugin graph cannot turn a benchmark into provisioning.
+ln -s -- "$fish_bin" "$nvim_runtime_bin/fish"
+
+isolated_git() {
+ env -i \
+ HOME="$benchmark_home" \
+ XDG_CONFIG_HOME="$xdg_config" \
+ XDG_DATA_HOME="$xdg_data" \
+ XDG_STATE_HOME="$xdg_state" \
+ XDG_CACHE_HOME="$xdg_cache" \
+ PATH="$runtime_bin" \
+ LC_ALL=C \
+ GIT_ATTR_NOSYSTEM=1 \
+ GIT_CONFIG_GLOBAL=/dev/null \
+ GIT_CONFIG_NOSYSTEM=1 \
+ GIT_NO_REPLACE_OBJECTS=1 \
+ GIT_TERMINAL_PROMPT=0 \
+ GIT_CONFIG_COUNT=3 \
+ GIT_CONFIG_KEY_0=core.hooksPath \
+ GIT_CONFIG_VALUE_0=/dev/null \
+ GIT_CONFIG_KEY_1=core.fsmonitor \
+ GIT_CONFIG_VALUE_1=false \
+ GIT_CONFIG_KEY_2=core.attributesFile \
+ GIT_CONFIG_VALUE_2=/dev/null \
+ "$git_bin" "$@"
+}
+
+isolated_git init --quiet --initial-branch=benchmark \
+ --template="$git_template" "$git_fixture"
+printf 'benchmark fixture\n' >"$git_fixture/tracked.txt"
+isolated_git -C "$git_fixture" add -- tracked.txt
+isolated_git -C "$git_fixture" \
+ -c user.name='Dotfiles Benchmark' \
+ -c user.email=benchmark.invalid \
+ -c commit.gpgsign=false \
+ commit --quiet --no-verify -m 'Create benchmark fixture'
+
+isolated_git init --quiet --initial-branch=benchmark \
+ --template="$git_template" "$large_git_fixture"
+"$python_bin" - "$large_git_fixture" <<'PY'
+import pathlib
+import sys
+
+root = pathlib.Path(sys.argv[1])
+for directory_index in range(100):
+ directory = root / f"component-{directory_index:03d}"
+ directory.mkdir()
+ for file_index in range(50):
+ (directory / f"file-{file_index:03d}.txt").write_text(
+ "tracked benchmark fixture\n", encoding="utf-8"
+ )
+PY
+isolated_git -C "$large_git_fixture" add -- .
+isolated_git -C "$large_git_fixture" \
+ -c user.name='Dotfiles Benchmark' \
+ -c user.email=benchmark.invalid \
+ -c commit.gpgsign=false \
+ commit --quiet --no-verify -m 'Create large benchmark fixture'
+
+commit=$(isolated_git -C "$repo_root" rev-parse --verify HEAD)
+if [[ -n $(isolated_git -C "$repo_root" status --porcelain --untracked-files=normal) ]]; then
+ worktree_state=dirty
+else
+ worktree_state=clean
+fi
+
+nvim_ready=0
+nvim_reason='pass --nvim-data with an already-provisioned Neovim data directory'
+if [[ -n $nvim_data ]]; then
+ if [[ -z $nvim_bin ]]; then
+ nvim_reason='Neovim is not installed'
+ elif [[ ! -d $nvim_data || -L $nvim_data ]]; then
+ nvim_reason='--nvim-data must be an existing, non-symlink directory'
+ else
+ nvim_source=$(cd -P -- "$nvim_data" && pwd -P)
+ dotfiles_validate_absolute_path "$nvim_source" 'Neovim data directory'
+ mkdir -p -- "$xdg_data/nvim"
+ if cp -pPR -- "$nvim_source/." "$xdg_data/nvim/"; then
+ mkdir -p -- "$xdg_config/nvim"
+ cp -pPR -- "$repo_root/home/dot_config/nvim/." "$xdg_config/nvim/"
+ nvim_preflight=
+ if ! nvim_preflight=$(env -i \
+ HOME="$benchmark_home" \
+ XDG_CONFIG_HOME="$xdg_config" \
+ XDG_DATA_HOME="$xdg_data" \
+ XDG_STATE_HOME="$xdg_state" \
+ XDG_CACHE_HOME="$xdg_cache" \
+ PATH="$runtime_bin" \
+ LC_ALL=C \
+ NVIM_APPNAME=nvim \
+ DOTFILES_NVIM_PREFLIGHT_SCRIPT="$repo_root/scripts/nvim-preflight.lua" \
+ "$nvim_bin" --clean --headless -u NONE \
+ '+lua dofile(vim.env.DOTFILES_NVIM_PREFLIGHT_SCRIPT)' +qa 2>&1); then
+ nvim_reason=${nvim_preflight:-'the isolated Neovim preflight failed'}
+ else
+ nvim_validation=
+ if nvim_validation=$(env -i \
+ HOME="$benchmark_home" \
+ PATH="$runtime_bin" \
+ LC_ALL=C \
+ GIT_ATTR_NOSYSTEM=1 \
+ GIT_CONFIG_GLOBAL=/dev/null \
+ GIT_CONFIG_NOSYSTEM=1 \
+ GIT_NO_REPLACE_OBJECTS=1 \
+ GIT_TERMINAL_PROMPT=0 \
+ GIT_CONFIG_COUNT=3 \
+ GIT_CONFIG_KEY_0=core.hooksPath \
+ GIT_CONFIG_VALUE_0=/dev/null \
+ GIT_CONFIG_KEY_1=core.fsmonitor \
+ GIT_CONFIG_VALUE_1=false \
+ GIT_CONFIG_KEY_2=core.attributesFile \
+ GIT_CONFIG_VALUE_2=/dev/null \
+ "$python_bin" - "$xdg_data/nvim" \
+ "$repo_root/home/dot_config/nvim/lazy-lock.json" "$git_bin" \
+ "$nvim_source" 2>&1 <<'PY'
+import json
+import os
+import pathlib
+import subprocess
+import sys
+
+data_root = pathlib.Path(sys.argv[1]).resolve()
+lock_path = pathlib.Path(sys.argv[2])
+git = sys.argv[3]
+source_root = pathlib.Path(sys.argv[4]).resolve()
+
+for directory, names, files in os.walk(data_root, followlinks=False):
+ for name in names + files:
+ path = pathlib.Path(directory, name)
+ if not path.is_symlink():
+ continue
+ link = os.readlink(path)
+ if os.path.isabs(link):
+ source_target = pathlib.Path(os.path.realpath(link))
+ try:
+ relative_target = source_target.relative_to(source_root)
+ except ValueError:
+ raise SystemExit(
+ f"absolute symlink escapes the source data directory: {path.relative_to(data_root)}"
+ )
+ copied_target = data_root / relative_target
+ if not os.path.lexists(copied_target):
+ raise SystemExit(
+ f"absolute symlink target was not copied: {path.relative_to(data_root)}"
+ )
+ path.unlink()
+ path.symlink_to(os.path.relpath(copied_target, start=path.parent))
+ target = pathlib.Path(os.path.realpath(path))
+ try:
+ target.relative_to(data_root)
+ except ValueError:
+ raise SystemExit(f"symlink escapes the isolated data directory: {path.relative_to(data_root)}")
+
+with lock_path.open(encoding="utf-8") as handle:
+ lock = json.load(handle)
+if not isinstance(lock, dict) or not lock:
+ raise SystemExit("the repository Neovim lock is empty or invalid")
+
+lazy_root = data_root / "lazy"
+for name, metadata in sorted(lock.items()):
+ if not isinstance(name, str) or not name or "/" in name or name in {".", ".."}:
+ raise SystemExit("the repository Neovim lock contains an unsafe plugin name")
+ expected = metadata.get("commit") if isinstance(metadata, dict) else None
+ if not isinstance(expected, str) or len(expected) != 40:
+ raise SystemExit(f"the repository Neovim lock has an invalid commit for {name}")
+ checkout = lazy_root / name
+ if checkout.is_symlink() or not checkout.is_dir():
+ raise SystemExit(f"the isolated data directory is missing a regular checkout for {name}")
+ result = subprocess.run(
+ [git, "--no-replace-objects", "-C", str(checkout), "rev-parse", "HEAD"],
+ check=False,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ text=True,
+ )
+ actual = result.stdout.strip()
+ if result.returncode != 0 or actual != expected:
+ raise SystemExit(f"the isolated checkout for {name} does not match the repository lock")
+
+print(f"validated {len(lock)} locked plugin checkouts")
+PY
+ ); then
+ nvim_ready=1
+ nvim_reason=$nvim_validation
+ else
+ nvim_reason=${nvim_validation:-'the isolated Neovim data directory failed validation'}
+ fi
+ fi
+ else
+ nvim_reason='the isolated Neovim data directory could not be copied'
+ fi
+ fi
+fi
+
+env -i \
+ HOME="$benchmark_home" \
+ XDG_CONFIG_HOME="$xdg_config" \
+ XDG_DATA_HOME="$xdg_data" \
+ XDG_STATE_HOME="$xdg_state" \
+ XDG_CACHE_HOME="$xdg_cache" \
+ TMPDIR="$benchmark_root" \
+ PATH="$benchmark_path" \
+ LC_ALL=C \
+ TERM=dumb \
+ NO_COLOR=1 \
+ GIT_ATTR_NOSYSTEM=1 \
+ GIT_CONFIG_GLOBAL=/dev/null \
+ GIT_CONFIG_NOSYSTEM=1 \
+ GIT_NO_REPLACE_OBJECTS=1 \
+ GIT_TERMINAL_PROMPT=0 \
+ GIT_CONFIG_COUNT=3 \
+ GIT_CONFIG_KEY_0=core.hooksPath \
+ GIT_CONFIG_VALUE_0=/dev/null \
+ GIT_CONFIG_KEY_1=core.fsmonitor \
+ GIT_CONFIG_VALUE_1=false \
+ GIT_CONFIG_KEY_2=core.attributesFile \
+ GIT_CONFIG_VALUE_2=/dev/null \
+ DOTFILES_BENCHMARK_PROMPT="$repo_root/home/dot_config/fish/functions/fish_prompt.fish" \
+ "$python_bin" - \
+ "$commit" "$worktree_state" \
+ "$samples" "$nvim_samples" "$warmups" \
+ "$fish_bin" "$git_bin" "$outside_git" "$git_fixture" "$large_git_fixture" \
+ "$nvim_bin" "$nvim_ready" "$nvim_reason" "$nvim_runtime_bin" <<'PY'
+import math
+import os
+import platform
+import re
+import statistics
+import subprocess
+import sys
+import time
+
+(
+ commit,
+ worktree_state,
+ sample_text,
+ nvim_sample_text,
+ warmup_text,
+ fish,
+ git,
+ outside_git,
+ git_fixture,
+ large_git_fixture,
+ nvim,
+ nvim_ready_text,
+ nvim_reason,
+ nvim_runtime_bin,
+) = sys.argv[1:]
+
+samples = int(sample_text)
+nvim_samples = int(nvim_sample_text)
+warmups = int(warmup_text)
+nvim_ready = nvim_ready_text == "1"
+base_env = os.environ.copy()
+
+
+def first_line(command, env=None):
+ try:
+ result = subprocess.run(
+ command,
+ check=False,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ text=True,
+ timeout=10,
+ env=env or base_env,
+ )
+ except (OSError, subprocess.TimeoutExpired):
+ return "unavailable"
+ output = result.stdout.splitlines()
+ return output[0].strip() if output else "unavailable"
+
+
+def configured_fish_integrations():
+ names = ("eza", "ghq+fzf", "lolcat", "thefuck", "zoxide")
+ fish_code = r'''
+function __dotfiles_benchmark_integration
+ printf "__DOTFILES_INTEGRATION__%s\n" $argv[1]
+end
+if functions -q l; and string match -q '*command eza*' -- (functions l)
+ __dotfiles_benchmark_integration eza
+end
+if bind \cg 2>/dev/null | string match -q '*__m1ng_ghq_repository_search*'
+ __dotfiles_benchmark_integration ghq+fzf
+end
+if command -q lolcat; and functions -q fish_greeting
+ __dotfiles_benchmark_integration lolcat
+end
+if functions -q fuck
+ __dotfiles_benchmark_integration thefuck
+end
+if functions -q z
+ __dotfiles_benchmark_integration zoxide
+end
+'''
+ try:
+ result = subprocess.run(
+ [fish, "--interactive", "-c", fish_code],
+ check=False,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.DEVNULL,
+ text=True,
+ timeout=10,
+ env=base_env,
+ )
+ except (OSError, subprocess.TimeoutExpired):
+ return "unavailable"
+ prefix = "__DOTFILES_INTEGRATION__"
+ present = [
+ line[len(prefix) :]
+ for line in result.stdout.splitlines()
+ if line.startswith(prefix) and line[len(prefix) :] in names
+ ]
+ return ", ".join(present) if present else "none"
+
+
+def cpu_model():
+ if sys.platform == "darwin":
+ value = first_line(["/usr/sbin/sysctl", "-n", "machdep.cpu.brand_string"])
+ if value != "unavailable":
+ return value
+ if sys.platform.startswith("linux"):
+ try:
+ with open("/proc/cpuinfo", encoding="utf-8") as handle:
+ for line in handle:
+ if line.lower().startswith(("model name", "hardware")):
+ return line.split(":", 1)[1].strip()
+ except (OSError, IndexError):
+ pass
+ return platform.processor() or "unavailable"
+
+
+def memory_total():
+ if sys.platform == "darwin":
+ value = first_line(["/usr/sbin/sysctl", "-n", "hw.memsize"])
+ try:
+ return f"{int(value) / (1024 ** 3):.1f} GiB"
+ except ValueError:
+ return "unavailable"
+ if sys.platform.startswith("linux"):
+ try:
+ with open("/proc/meminfo", encoding="utf-8") as handle:
+ for line in handle:
+ if line.startswith("MemTotal:"):
+ kib = int(line.split()[1])
+ return f"{kib / (1024 ** 2):.1f} GiB"
+ except (OSError, ValueError, IndexError):
+ pass
+ return "unavailable"
+
+
+def run_process(command, count, env, timeout):
+ durations = []
+ for index in range(warmups + count):
+ started = time.perf_counter_ns()
+ try:
+ result = subprocess.run(
+ command,
+ check=False,
+ stdin=subprocess.DEVNULL,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ timeout=timeout,
+ env=env,
+ )
+ except subprocess.TimeoutExpired as error:
+ raise RuntimeError(f"timed out after {timeout} seconds") from error
+ if result.returncode != 0:
+ raise RuntimeError(f"exited with status {result.returncode}")
+ elapsed = (time.perf_counter_ns() - started) / 1_000_000
+ if index >= warmups:
+ durations.append(elapsed)
+ return durations
+
+
+def run_prompt(directory, count):
+ iterations = warmups + count
+ prompt_env = base_env.copy()
+ prompt_env["DOTFILES_BENCHMARK_ITERATIONS"] = str(iterations)
+ fish_code = r'''
+source "$DOTFILES_BENCHMARK_PROMPT"
+set -l remaining $DOTFILES_BENCHMARK_ITERATIONS
+while test $remaining -gt 0
+ time fish_prompt >/dev/null
+ set remaining (math $remaining - 1)
+end
+'''
+ try:
+ result = subprocess.run(
+ [fish, "--no-config", "-c", fish_code],
+ check=False,
+ cwd=directory,
+ stdin=subprocess.DEVNULL,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.PIPE,
+ text=True,
+ timeout=max(30, iterations * 0.5),
+ env=prompt_env,
+ )
+ except subprocess.TimeoutExpired as error:
+ raise RuntimeError("timed out while measuring Fish prompt renders") from error
+ if result.returncode != 0:
+ raise RuntimeError(f"Fish prompt measurement exited with status {result.returncode}")
+
+ matches = re.findall(
+ r"^Executed in\s+([0-9]+(?:\.[0-9]+)?)\s+(micros|millis|secs)\b",
+ result.stderr,
+ re.MULTILINE,
+ )
+ if len(matches) != iterations:
+ raise RuntimeError(
+ f"expected {iterations} Fish prompt timings, received {len(matches)}"
+ )
+ scale = {"micros": 0.001, "millis": 1.0, "secs": 1000.0}
+ durations = [float(value) * scale[unit] for value, unit in matches]
+ return durations[warmups:]
+
+
+def percentile(values, fraction):
+ ordered = sorted(values)
+ position = (len(ordered) - 1) * fraction
+ lower = math.floor(position)
+ upper = math.ceil(position)
+ if lower == upper:
+ return ordered[lower]
+ weight = position - lower
+ return ordered[lower] * (1 - weight) + ordered[upper] * weight
+
+
+def summary(values, conservative=False):
+ fields = [f"samples={len(values)}", f"min={min(values):.3f}"]
+ fields.append(f"p50={statistics.median(values):.3f}")
+ if not conservative and len(values) >= 20:
+ fields.append(f"p95={percentile(values, 0.95):.3f}")
+ if not conservative and len(values) >= 100:
+ fields.append(f"p99={percentile(values, 0.99):.3f}")
+ fields.append(f"max={max(values):.3f}")
+ return " ".join(fields)
+
+
+try:
+ load = ", ".join(f"{value:.2f}" for value in os.getloadavg())
+except (AttributeError, OSError):
+ load = "unavailable"
+
+print("Benchmark environment")
+print(f" Commit: {commit} ({worktree_state} worktree)")
+print(f" OS: {platform.platform()}")
+print(f" Architecture: {platform.machine() or 'unavailable'}")
+print(f" CPU: {cpu_model()}")
+print(f" Logical CPUs: {os.cpu_count() or 'unavailable'}")
+print(f" Memory: {memory_total()}")
+print(f" Load average before measurement: {load}")
+print(f" Python: {platform.python_version()}")
+print(f" {first_line([fish, '--version'])}")
+print(f" {first_line([git, '--version'])}")
+if nvim:
+ print(f" {first_line([nvim, '--version'])}")
+print(f" Warm-up iterations: {warmups}")
+print(" Isolation: temporary HOME/XDG and sanitized Git configuration")
+print(f" Active configured Fish integrations: {configured_fish_integrations()}")
+print()
+print("Results (milliseconds, lower is better)")
+
+try:
+ core = run_process(
+ [fish, "--no-config", "--interactive", "-c", "exit"],
+ samples,
+ base_env,
+ 10,
+ )
+ configured = run_process(
+ [fish, "--interactive", "-c", "exit"], samples, base_env, 10
+ )
+ outside = run_prompt(outside_git, samples)
+ inside = run_prompt(git_fixture, samples)
+ large = run_prompt(large_git_fixture, samples)
+except (OSError, RuntimeError) as error:
+ print(f"error: Fish benchmark failed: {error}", file=sys.stderr)
+ raise SystemExit(1)
+
+print(f" Fish core startup: {summary(core)}")
+print(f" Fish configured startup: {summary(configured)}")
+print(f" Prompt outside Git: {summary(outside)}")
+print(f" Prompt in small Git repo: {summary(inside)}")
+print(f" Prompt in 5k-file repo: {summary(large)}")
+
+if not nvim_ready:
+ print(f" Warm Neovim startup: skipped ({nvim_reason})")
+else:
+ nvim_env = base_env.copy()
+ nvim_env.update(
+ {
+ "PATH": nvim_runtime_bin,
+ "NVIM_APPNAME": "nvim",
+ "http_proxy": "http://127.0.0.1:9",
+ "https_proxy": "http://127.0.0.1:9",
+ "HTTP_PROXY": "http://127.0.0.1:9",
+ "HTTPS_PROXY": "http://127.0.0.1:9",
+ "ALL_PROXY": "socks5h://127.0.0.1:9",
+ "NO_PROXY": "localhost,127.0.0.1",
+ }
+ )
+ try:
+ probe = subprocess.run(
+ [nvim, "--cmd", "let g:dotfiles_benchmark = 1", "--headless", "+qa"],
+ check=False,
+ stdin=subprocess.DEVNULL,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ timeout=30,
+ env=nvim_env,
+ )
+ if probe.returncode != 0:
+ raise RuntimeError(f"isolated warm-up exited with status {probe.returncode}")
+ nvim_values = run_process(
+ [nvim, "--cmd", "let g:dotfiles_benchmark = 1", "--headless", "+qa"],
+ nvim_samples,
+ nvim_env,
+ 30,
+ )
+ except (OSError, RuntimeError, subprocess.TimeoutExpired) as error:
+ print(f" Warm Neovim startup: skipped ({error})")
+ else:
+ conservative = len(nvim_values) < 100
+ print(f" Warm Neovim startup: {summary(nvim_values, conservative)}")
+
+print()
+if samples < 100:
+ print("Note: p99 is omitted because fewer than 100 Fish/prompt samples were requested.")
+if nvim_ready and nvim_samples < 100:
+ print("Note: warm Neovim uses median/range below 100 samples; raise --nvim-samples to 100 for tail percentiles.")
+print("Compare results only under similar hardware, power, thermal, and load conditions.")
+print("No absolute pass/fail budget is applied.")
+PY
diff --git a/scripts/bootstrap b/scripts/bootstrap
new file mode 100755
index 0000000..96cc3f4
--- /dev/null
+++ b/scripts/bootstrap
@@ -0,0 +1,423 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
+repo_root=$(cd -P -- "$script_dir/.." && pwd -P)
+# shellcheck disable=SC1091
+source "$script_dir/lib/safety.bash"
+
+bootstrap_apply=0
+bootstrap_force=0
+bootstrap_clean_legacy=0
+bootstrap_noninteractive=0
+bootstrap_destination=${HOME:-}
+bootstrap_destination_explicit=0
+bootstrap_linux_x11=
+bootstrap_chezmoi=
+bootstrap_backup_parent=
+bootstrap_config_exists=0
+bootstrap_tmp_root=
+bootstrap_tmp_parent=
+bootstrap_backup=
+bootstrap_transaction_active=0
+
+bootstrap_assert_destination_internal_path() {
+ local relative=$1
+ local expected_type=$2
+ local description=$3
+ local target
+
+ dotfiles_validate_relative_path "$relative"
+ dotfiles_assert_safe_parent_chain "$bootstrap_destination" "$relative"
+ target="$bootstrap_destination/$relative"
+ [[ ! -L $target ]] || dotfiles_die "refusing symlinked $description: $target"
+
+ if [[ -e $target ]]; then
+ case $expected_type in
+ directory)
+ [[ -d $target ]] || dotfiles_die "$description is not a directory: $target"
+ ;;
+ file)
+ [[ -f $target ]] || dotfiles_die "$description is not a regular file: $target"
+ ;;
+ *)
+ dotfiles_die "internal error: invalid destination path type: $expected_type"
+ ;;
+ esac
+ fi
+}
+
+usage() {
+ cat <<'EOF'
+Usage: scripts/bootstrap [OPTIONS]
+
+By default, initialize chezmoi from this checkout and show `chezmoi diff`.
+No managed target is written unless --apply is supplied.
+
+Options:
+ --apply Back up existing targets, then apply interactively.
+ --force With --apply, overwrite after preview and backup.
+ --clean-legacy With --apply, remove backed-up retired Fish files.
+ --linux-x11 Enable the Linux X11/i3 profile explicitly.
+ --no-linux-x11 Disable the Linux X11/i3 profile explicitly.
+ --non-interactive Disable prompts; a new config defaults X11 off.
+ --destination DIR Use DIR as the destination/home (isolated for CI).
+ --backup-parent DIR Store pre-apply backups below DIR.
+ --chezmoi PATH Use an explicit chezmoi executable.
+ -h, --help Show this help.
+
+For a clean CI smoke test, use a freshly-created absolute --destination with
+--non-interactive --no-linux-x11 --apply.
+EOF
+}
+
+cleanup() {
+ if [[ -n $bootstrap_tmp_root && -n $bootstrap_tmp_parent ]]; then
+ dotfiles_safe_cleanup_tree "$bootstrap_tmp_root" "$bootstrap_tmp_parent" dotfiles-bootstrap.
+ bootstrap_tmp_root=
+ fi
+}
+
+exit_for_signal() {
+ local status=$1
+
+ # A second signal must not recurse into an in-progress rollback. The
+ # transaction helper marks itself inactive before invoking restore.
+ trap - HUP INT TERM
+ if ((bootstrap_transaction_active == 1)) && [[ -n $bootstrap_backup ]]; then
+ rollback_apply 'Apply interrupted by a signal'
+ fi
+ cleanup || true
+ trap - EXIT
+ exit "$status"
+}
+
+trap cleanup EXIT
+trap 'exit_for_signal 129' HUP
+trap 'exit_for_signal 130' INT
+trap 'exit_for_signal 143' TERM
+
+while (($# > 0)); do
+ case $1 in
+ --apply)
+ bootstrap_apply=1
+ shift
+ ;;
+ --force)
+ bootstrap_force=1
+ shift
+ ;;
+ --clean-legacy)
+ bootstrap_clean_legacy=1
+ shift
+ ;;
+ --linux-x11)
+ [[ -z $bootstrap_linux_x11 ]] || dotfiles_die 'choose only one Linux X11 option'
+ bootstrap_linux_x11=true
+ shift
+ ;;
+ --no-linux-x11)
+ [[ -z $bootstrap_linux_x11 ]] || dotfiles_die 'choose only one Linux X11 option'
+ bootstrap_linux_x11=false
+ shift
+ ;;
+ --non-interactive)
+ bootstrap_noninteractive=1
+ shift
+ ;;
+ --destination)
+ (($# >= 2)) || dotfiles_die '--destination requires an argument'
+ bootstrap_destination=$2
+ bootstrap_destination_explicit=1
+ shift 2
+ ;;
+ --destination=*)
+ bootstrap_destination=${1#*=}
+ bootstrap_destination_explicit=1
+ shift
+ ;;
+ --backup-parent)
+ (($# >= 2)) || dotfiles_die '--backup-parent requires an argument'
+ bootstrap_backup_parent=$2
+ shift 2
+ ;;
+ --backup-parent=*)
+ bootstrap_backup_parent=${1#*=}
+ shift
+ ;;
+ --chezmoi)
+ (($# >= 2)) || dotfiles_die '--chezmoi requires an argument'
+ bootstrap_chezmoi=$2
+ shift 2
+ ;;
+ --chezmoi=*)
+ bootstrap_chezmoi=${1#*=}
+ shift
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ *)
+ dotfiles_die "unknown argument: $1"
+ ;;
+ esac
+done
+
+((bootstrap_force == 0 || bootstrap_apply == 1)) ||
+ dotfiles_die '--force requires --apply'
+((bootstrap_clean_legacy == 0 || bootstrap_apply == 1)) ||
+ dotfiles_die '--clean-legacy requires --apply'
+
+[[ -f $repo_root/.chezmoiroot ]] || dotfiles_die 'repository is missing .chezmoiroot'
+[[ $(<"$repo_root/.chezmoiroot") == home ]] || dotfiles_die '.chezmoiroot must contain home'
+[[ -d $repo_root/home ]] || dotfiles_die 'repository is missing the home source-state directory'
+bootstrap_legacy_manifest="$script_dir/legacy-fish-paths"
+[[ -f $bootstrap_legacy_manifest && ! -L $bootstrap_legacy_manifest ]] ||
+ dotfiles_die "repository is missing the regular legacy Fish manifest: $bootstrap_legacy_manifest"
+
+if [[ -z $bootstrap_chezmoi ]]; then
+ bootstrap_chezmoi=$(command -v chezmoi 2>/dev/null || true)
+fi
+[[ -n $bootstrap_chezmoi ]] ||
+ dotfiles_die 'chezmoi is not available; run scripts/install-chezmoi first'
+[[ $bootstrap_chezmoi == /* ]] || dotfiles_die "chezmoi path must be absolute: $bootstrap_chezmoi"
+[[ -x $bootstrap_chezmoi && ! -d $bootstrap_chezmoi ]] ||
+ dotfiles_die "chezmoi is not executable: $bootstrap_chezmoi"
+
+[[ -n $bootstrap_destination ]] || dotfiles_die 'HOME is unset; pass --destination explicitly'
+bootstrap_destination=$(dotfiles_prepare_directory "$bootstrap_destination" 'destination')
+if [[ -n $bootstrap_backup_parent ]]; then
+ dotfiles_validate_absolute_path "$bootstrap_backup_parent" 'backup parent'
+fi
+
+bootstrap_uname=$(uname -s)
+if [[ $bootstrap_linux_x11 == true && $bootstrap_uname != Linux ]]; then
+ dotfiles_die '--linux-x11 is supported only on Linux'
+fi
+bootstrap_tmp_parent=${TMPDIR:-/tmp}
+bootstrap_tmp_parent=$(dotfiles_existing_directory "$bootstrap_tmp_parent" 'temporary directory')
+bootstrap_tmp_root=$(mktemp -d "$bootstrap_tmp_parent/dotfiles-bootstrap.XXXXXXXX")
+bootstrap_managed_paths="$bootstrap_tmp_root/managed-paths"
+bootstrap_managed_dirs="$bootstrap_tmp_root/managed-dirs"
+bootstrap_legacy_existing="$bootstrap_tmp_root/legacy-existing"
+: >"$bootstrap_legacy_existing"
+
+cm=(
+ "$bootstrap_chezmoi"
+ --source "$repo_root"
+ --destination "$bootstrap_destination"
+)
+
+if ((bootstrap_destination_explicit == 1)); then
+ bootstrap_config_relative=.config/chezmoi/chezmoi.toml
+ bootstrap_cache_relative=.cache/chezmoi
+ bootstrap_state_relative=.local/state/chezmoi/chezmoistate.boltdb
+
+ # Validate all three destination-internal paths before creating any of their
+ # directories. This prevents mkdir and chezmoi init from following an
+ # existing parent symlink and writing outside the selected destination.
+ bootstrap_assert_destination_internal_path \
+ "$bootstrap_config_relative" file 'chezmoi config path'
+ bootstrap_assert_destination_internal_path \
+ "$bootstrap_cache_relative" directory 'chezmoi cache path'
+ bootstrap_assert_destination_internal_path \
+ "$bootstrap_state_relative" file 'chezmoi persistent state path'
+ if [[ -z $bootstrap_backup_parent ]]; then
+ # The destination-local default is trusted only after validating every
+ # existing parent and its endpoint. An explicitly supplied absolute
+ # --backup-parent remains the opt-in route to an external backup volume.
+ bootstrap_backup_relative=.local/state/dotfiles/backups
+ bootstrap_assert_destination_internal_path \
+ "$bootstrap_backup_relative" directory 'default backup path'
+ fi
+
+ bootstrap_config="$bootstrap_destination/$bootstrap_config_relative"
+ bootstrap_cache="$bootstrap_destination/$bootstrap_cache_relative"
+ bootstrap_state="$bootstrap_destination/$bootstrap_state_relative"
+ mkdir -p -- "$(dirname -- "$bootstrap_config")" "$bootstrap_cache" "$(dirname -- "$bootstrap_state")"
+ cm+=(
+ --config "$bootstrap_config"
+ --config-format toml
+ --cache "$bootstrap_cache"
+ --persistent-state "$bootstrap_state"
+ )
+else
+ bootstrap_config=$(
+ "$bootstrap_chezmoi" --destination "$bootstrap_destination" \
+ execute-template '{{ .chezmoi.configFile }}'
+ )
+fi
+
+dotfiles_validate_absolute_path "$bootstrap_config" 'chezmoi config path'
+if [[ -e $bootstrap_config || -L $bootstrap_config ]]; then
+ bootstrap_config_exists=1
+ [[ -f $bootstrap_config && ! -L $bootstrap_config ]] ||
+ dotfiles_die "existing chezmoi config must be a regular, non-symlink file: $bootstrap_config"
+ configured_source_args=(
+ "$bootstrap_chezmoi"
+ --destination "$bootstrap_destination"
+ --config "$bootstrap_config"
+ )
+ if ((bootstrap_destination_explicit == 1)); then
+ configured_source_args+=(--config-format toml)
+ fi
+ configured_source=$("${configured_source_args[@]}" execute-template '{{ .chezmoi.workingTree }}') ||
+ dotfiles_die "could not read sourceDir from existing config: $bootstrap_config"
+ if [[ -d $configured_source ]]; then
+ configured_source=$(dotfiles_existing_directory "$configured_source" 'configured sourceDir')
+ fi
+ if [[ $configured_source != "$repo_root" ]]; then
+ dotfiles_die "existing chezmoi config points to another sourceDir ($configured_source); refusing to overwrite $bootstrap_config"
+ fi
+fi
+
+# A non-interactive first initialization needs a prompt default. Once a config
+# exists, an omitted profile flag must respect its persisted machine choice.
+if [[ -z $bootstrap_linux_x11 && $bootstrap_noninteractive -eq 1 && $bootstrap_config_exists -eq 0 ]]; then
+ bootstrap_linux_x11=false
+fi
+
+if [[ -n $bootstrap_linux_x11 ]]; then
+ cm+=(--override-data "{\"profiles\":{\"linuxX11\":$bootstrap_linux_x11}}")
+fi
+if ((bootstrap_noninteractive == 1)); then
+ cm+=(--no-tty)
+fi
+
+if ((bootstrap_config_exists == 0)); then
+ printf 'Initializing chezmoi source state from %s\n' "$repo_root"
+ bootstrap_init_args=(init)
+ if [[ -n $bootstrap_linux_x11 ]]; then
+ # Config-template prompts run before --override-data is merged into the
+ # source-state data. Seed the matching init prompt explicitly, while
+ # retaining the override for all templates rendered after initialization.
+ bootstrap_init_args+=(
+ --promptBool "Enable the Linux X11/i3 profile=$bootstrap_linux_x11"
+ )
+ fi
+ "${cm[@]}" "${bootstrap_init_args[@]}"
+else
+ printf 'Using the existing same-source chezmoi config without regenerating it: %s\n' "$bootstrap_config"
+ if [[ -n $bootstrap_linux_x11 ]]; then
+ printf 'Note: the explicit X11 profile overrides this run only; edit data.profiles.linuxX11 in the existing config to persist a profile change.\n'
+ fi
+fi
+
+printf '\nPlanned target changes:\n'
+"${cm[@]}" --no-pager diff
+
+while IFS= read -r legacy_path || [[ -n $legacy_path ]]; do
+ dotfiles_validate_relative_path "$legacy_path"
+ dotfiles_assert_safe_parent_chain "$bootstrap_destination" "$legacy_path"
+ legacy_target="$bootstrap_destination/$legacy_path"
+ if [[ -e $legacy_target || -L $legacy_target ]]; then
+ [[ ! -d $legacy_target || -L $legacy_target ]] ||
+ dotfiles_die "legacy Fish path unexpectedly became a directory: $legacy_target"
+ printf '%s\n' "$legacy_path" >>"$bootstrap_legacy_existing"
+ fi
+done <"$bootstrap_legacy_manifest"
+
+if [[ -s $bootstrap_legacy_existing ]]; then
+ printf '\nDetected retired files from the pre-chezmoi Fish layout:\n'
+ sed 's/^/ /' "$bootstrap_legacy_existing"
+ if ((bootstrap_clean_legacy == 1)); then
+ printf 'These exact paths will be backed up and removed after a successful apply.\n'
+ else
+ printf 'They are not managed or removed automatically; rerun with --apply --clean-legacy after review.\n'
+ fi
+fi
+if [[ -e $bootstrap_destination/.config/fish/fish_variables ]]; then
+ printf '\nNote: .config/fish/fish_variables is mutable Fish state and is never removed automatically; inspect universal variables separately during an upgrade.\n'
+fi
+
+if ((bootstrap_apply == 0)); then
+ printf '\nPreview only; rerun with --apply to back up and write managed targets.\n'
+ exit 0
+fi
+
+"${cm[@]}" managed --format= --include=files,symlinks --path-style=relative >"$bootstrap_managed_paths"
+"${cm[@]}" managed --format= --include=dirs --path-style=relative >"$bootstrap_managed_dirs"
+if ((bootstrap_clean_legacy == 1)); then
+ while IFS= read -r legacy_path || [[ -n $legacy_path ]]; do
+ grep -Fqx -- "$legacy_path" "$bootstrap_managed_paths" ||
+ printf '%s\n' "$legacy_path" >>"$bootstrap_managed_paths"
+ done <"$bootstrap_legacy_existing"
+fi
+if [[ -z $bootstrap_backup_parent ]]; then
+ if ((bootstrap_destination_explicit == 1)); then
+ bootstrap_backup_parent="$bootstrap_destination/.local/state/dotfiles/backups"
+ else
+ bootstrap_backup_parent="${XDG_STATE_HOME:-$bootstrap_destination/.local/state}/dotfiles/backups"
+ fi
+fi
+dotfiles_validate_absolute_path "$bootstrap_backup_parent" 'backup parent'
+
+printf '\nBacking up all existing managed targets before apply.\n'
+bootstrap_backup=$(
+ "$script_dir/backup" \
+ --destination "$bootstrap_destination" \
+ --output-parent "$bootstrap_backup_parent" \
+ --directories-file "$bootstrap_managed_dirs" \
+ --paths-file "$bootstrap_managed_paths"
+)
+printf 'Backup: %s\n' "$bootstrap_backup"
+
+rollback_apply() {
+ bootstrap_transaction_active=0
+ printf '%s; restoring the pre-apply files, symlinks, and directory modes from this run.\n' "$1" >&2
+ if "$script_dir/restore" --apply --remove-created "$bootstrap_backup"; then
+ printf 'Automatic rollback completed. Newly-created directories are intentionally left in place.\n' >&2
+ else
+ printf 'Automatic rollback also failed. Preview the retained backup with:\n %q %q\n' \
+ "$script_dir/restore" "$bootstrap_backup" >&2
+ fi
+}
+
+printf '\nApplying managed targets.\n'
+if ((bootstrap_force == 1)); then
+ bootstrap_apply_args=(--force)
+else
+ bootstrap_apply_args=(--less-interactive)
+fi
+bootstrap_transaction_active=1
+if ! "${cm[@]}" "${bootstrap_apply_args[@]}" apply; then
+ rollback_apply 'Apply failed'
+ if ((bootstrap_noninteractive == 1 && bootstrap_force == 0)); then
+ printf 'A non-interactive migration with pre-existing targets requires explicit --force after reviewing the diff and backup.\n' >&2
+ fi
+ exit 1
+fi
+
+if ! "${cm[@]}" verify; then
+ rollback_apply 'Post-apply verification failed or the interactive migration was cancelled'
+ exit 1
+fi
+
+clean_legacy_paths() (
+ # This function is deliberately called from an `if ! ...` condition, where
+ # Bash disables errexit inheritance. Check every operation that can fail so
+ # a partial cleanup can never be mistaken for a committed transaction.
+ printf '\nRemoving backed-up retired Fish paths.\n' || return 1
+ while IFS= read -r legacy_path || [[ -n $legacy_path ]]; do
+ dotfiles_assert_safe_parent_chain "$bootstrap_destination" "$legacy_path" || return 1
+ legacy_target="$bootstrap_destination/$legacy_path"
+ if [[ -d $legacy_target && ! -L $legacy_target ]]; then
+ printf 'error: refusing to remove a legacy path that became a directory: %s\n' \
+ "$legacy_target" >&2 || return 1
+ return 1
+ fi
+ rm -f -- "$legacy_target" || return 1
+ printf 'removed %s\n' "$legacy_path" || return 1
+ done <"$bootstrap_legacy_existing"
+)
+
+if ((bootstrap_clean_legacy == 1)) && [[ -s $bootstrap_legacy_existing ]]; then
+ if ! clean_legacy_paths; then
+ rollback_apply 'Retired Fish cleanup failed'
+ exit 1
+ fi
+fi
+bootstrap_transaction_active=0
+printf 'Apply and verification completed successfully.\n'
diff --git a/scripts/check b/scripts/check
new file mode 100755
index 0000000..45cf87a
--- /dev/null
+++ b/scripts/check
@@ -0,0 +1,3030 @@
+#!/usr/bin/env bash
+
+set -uo pipefail
+
+repo_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
+cd "$repo_root" || exit 1
+# shellcheck disable=SC1091
+source "$repo_root/scripts/lib/safety.bash"
+
+failures=0
+skips=0
+strict=${DOTFILES_CHECK_STRICT:-0}
+
+pass() {
+ printf 'ok %s\n' "$1"
+}
+
+fail() {
+ printf 'FAIL %s\n' "$1" >&2
+ failures=$((failures + 1))
+}
+
+skip() {
+ printf 'skip %s\n' "$1"
+ skips=$((skips + 1))
+}
+
+have() {
+ command -v "$1" >/dev/null 2>&1
+}
+
+run() {
+ local description=$1
+ local status
+ shift
+
+ # Invoke outside an if/&& conditional so a check's own `set -e` remains
+ # effective. Bash otherwise disables errexit throughout called functions.
+ "$@"
+ status=$?
+ if ((status == 0)); then
+ pass "$description"
+ else
+ fail "$description"
+ fi
+ return 0
+}
+
+optional() {
+ local command_name=$1
+ local description=$2
+ shift 2
+
+ if have "$command_name"; then
+ run "$description" "$@"
+ elif [[ $strict == 1 ]]; then
+ fail "$description (missing: $command_name)"
+ else
+ skip "$description (missing: $command_name)"
+ fi
+}
+
+check_no_personal_paths() {
+ local output
+
+ if ! have rg; then
+ return 127
+ fi
+
+ output=$(rg -n --hidden \
+ --glob '!.git/**' \
+ '(^|[^[:alnum:]_}])\/(Users|home)\/[[:alnum:]_.-]+\/' . 2>/dev/null) || {
+ local status=$?
+ [[ $status == 1 ]] && return 0
+ return "$status"
+ }
+
+ printf '%s\n' "$output" >&2
+ return 1
+}
+
+check_repository_whitespace() {
+ git diff --check || return 1
+ git diff --cached --check || return 1
+
+ python3 - <<'PY'
+import os
+import pathlib
+import subprocess
+
+listed = subprocess.run(
+ ["git", "ls-files", "-z", "--cached", "--others", "--exclude-standard"],
+ check=True,
+ stdout=subprocess.PIPE,
+).stdout
+problems = []
+
+for encoded in listed.split(b"\0"):
+ if not encoded:
+ continue
+ relative = os.fsdecode(encoded)
+ path = pathlib.Path(relative)
+ if path.is_symlink() or not path.is_file():
+ continue
+ data = path.read_bytes()
+ if b"\0" in data:
+ continue
+ for number, line in enumerate(data.splitlines(keepends=True), start=1):
+ body = line.rstrip(b"\r\n")
+ if body.endswith((b" ", b"\t")):
+ problems.append(f"{relative}:{number}: trailing whitespace")
+ if data and not data.endswith(b"\n"):
+ problems.append(f"{relative}: missing final newline")
+
+if problems:
+ raise SystemExit("\n".join(problems))
+PY
+}
+
+check_fish() {
+ local file
+ local -a files=()
+
+ while IFS= read -r -d '' file; do
+ files+=("$file")
+ done < <(find home/dot_config/fish -type f -name '*.fish' -print0 | LC_ALL=C sort -z)
+
+ if ((${#files[@]} != 14)); then
+ printf 'expected 14 Fish files, found %d\n' "${#files[@]}" >&2
+ return 1
+ fi
+
+ for file in "${files[@]}"; do
+ fish -n "$file" || return 1
+ done
+}
+
+check_fish_format() {
+ local -a owned_files=(
+ home/dot_config/fish/config.fish
+ home/dot_config/fish/conf.d/00_xdg_defaults.fish
+ home/dot_config/fish/conf.d/eza.fish
+ home/dot_config/fish/conf.d/m1ng_ghq_key_bindings.fish
+ home/dot_config/fish/conf.d/zoxide.fish
+ home/dot_config/fish/functions/__m1ng_ghq_repository_search.fish
+ home/dot_config/fish/functions/fish_prompt.fish
+ )
+
+ # nvm.fish is pinned third-party source. Check its syntax, but never rewrite
+ # or enforce local formatting on it.
+ fish_indent --check "${owned_files[@]}"
+}
+
+check_fish_xdg_defaults() (
+ set -euo pipefail
+
+ local fish_parent
+ local fish_root
+
+ fish_parent=${TMPDIR:-/tmp}
+ fish_parent=$(cd -P -- "$fish_parent" && pwd -P)
+ fish_root=$(mktemp -d "$fish_parent/dotfiles-fish.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$fish_root" "$fish_parent" dotfiles-fish.' EXIT HUP INT TERM
+ mkdir -p -- "$fish_root/home"
+ cd "$fish_root"
+
+ # Fish expands these variables inside its own single-quoted command.
+ # shellcheck disable=SC2016
+ env -i \
+ HOME="$fish_root/home" \
+ PATH="$PATH" \
+ DOTFILES_REPO_ROOT="$repo_root" \
+ XDG_CONFIG_HOME= \
+ XDG_DATA_HOME=relative/data \
+ XDG_STATE_HOME=relative/state \
+ XDG_CACHE_HOME= \
+ fish --no-config -c '
+ source "$DOTFILES_REPO_ROOT/home/dot_config/fish/conf.d/00_xdg_defaults.fish"
+ test "$XDG_CONFIG_HOME" = "$HOME/.config"
+ and test "$XDG_DATA_HOME" = "$HOME/.local/share"
+ and test "$XDG_STATE_HOME" = "$HOME/.local/state"
+ and test "$XDG_CACHE_HOME" = "$HOME/.cache"
+ and source "$DOTFILES_REPO_ROOT/home/dot_config/fish/conf.d/nvm.fish"
+ and test "$nvm_data" = "$HOME/.local/share/nvm"
+ '
+)
+
+check_legacy_fish_manifest() {
+ python3 - <<'PY'
+import pathlib
+
+manifest = pathlib.Path("scripts/legacy-fish-paths")
+paths = manifest.read_text(encoding="utf-8").splitlines()
+if len(paths) != 96 or paths != sorted(set(paths)):
+ raise SystemExit("legacy Fish manifest must contain 96 sorted unique paths")
+if ".config/fish/fish_variables" in paths:
+ raise SystemExit("mutable fish_variables must never be in the automatic cleanup manifest")
+
+current_root = pathlib.Path("home/dot_config/fish")
+current = {
+ ".config/fish/" + path.relative_to(current_root).as_posix()
+ for path in current_root.rglob("*")
+ if path.is_file()
+}
+for relative in paths:
+ path = pathlib.PurePosixPath(relative)
+ if path.is_absolute() or ".." in path.parts or path.parts[:2] != (".config", "fish"):
+ raise SystemExit(f"unsafe legacy Fish path: {relative}")
+ if relative in current:
+ raise SystemExit(f"legacy Fish path overlaps current source state: {relative}")
+PY
+}
+
+check_fish_go_path() (
+ set -euo pipefail
+
+ local fish_executable
+ local fish_parent
+ local fish_root
+ local fish_home
+ local first_gopath
+ local second_gopath
+ local gobin
+
+ fish_executable=$(command -v fish)
+ [[ $fish_executable == /* ]]
+
+ fish_parent=${TMPDIR:-/tmp}
+ fish_parent=$(cd -P -- "$fish_parent" && pwd -P)
+ fish_root=$(mktemp -d "$fish_parent/dotfiles-fish-go.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$fish_root" "$fish_parent" dotfiles-fish-go.' EXIT HUP INT TERM
+
+ fish_home="$fish_root/home"
+ first_gopath="$fish_root/go-first"
+ second_gopath="$fish_root/go-second"
+ gobin="$fish_root/gobin"
+ mkdir -p -- \
+ "$fish_home/go/bin" \
+ "$first_gopath/bin" \
+ "$second_gopath/bin" \
+ "$gobin"
+
+ # --no-config excludes host integrations; fish_add_path records its global
+ # additions in fish_user_paths, which normal Fish startup projects into PATH.
+ # Fish expands these variables inside its own single-quoted command.
+ # shellcheck disable=SC2016
+ env -i \
+ HOME="$fish_home" \
+ PATH="$PATH" \
+ DOTFILES_REPO_ROOT="$repo_root" \
+ GOBIN="$gobin" \
+ GOPATH="$first_gopath:$second_gopath" \
+ "$fish_executable" --no-config -c '
+ source "$DOTFILES_REPO_ROOT/home/dot_config/fish/config.fish"
+ test (count $GOPATH) -eq 2
+ and contains -- "$GOBIN" $fish_user_paths
+ and not contains -- "$GOPATH[1]/bin" $fish_user_paths
+ and not contains -- "$GOPATH[2]/bin" $fish_user_paths
+ ' || return 1
+
+ # shellcheck disable=SC2016
+ env -i \
+ HOME="$fish_home" \
+ PATH="$PATH" \
+ DOTFILES_REPO_ROOT="$repo_root" \
+ GOBIN= \
+ GOPATH="$first_gopath:$second_gopath" \
+ "$fish_executable" --no-config -c '
+ source "$DOTFILES_REPO_ROOT/home/dot_config/fish/config.fish"
+ test (count $GOPATH) -eq 2
+ and contains -- "$GOPATH[1]/bin" $fish_user_paths
+ and not contains -- "$GOPATH[2]/bin" $fish_user_paths
+ ' || return 1
+
+ # shellcheck disable=SC2016
+ env -i \
+ HOME="$fish_home" \
+ PATH="$PATH" \
+ DOTFILES_REPO_ROOT="$repo_root" \
+ GOBIN=relative/bin \
+ GOPATH= \
+ "$fish_executable" --no-config -c '
+ source "$DOTFILES_REPO_ROOT/home/dot_config/fish/config.fish"
+ contains -- "$HOME/go/bin" $fish_user_paths
+ ' || return 1
+)
+
+check_fish_prompt_behavior() (
+ set -euo pipefail
+
+ local prompt_parent
+ local prompt_root
+ local prompt_home
+ local prompt_repo
+ local prompt_outside
+ local prompt_file
+ local prompt_command
+ local prompt_template
+ local output
+ local blob
+ local detached
+
+ prompt_parent=${TMPDIR:-/tmp}
+ prompt_parent=$(cd -P -- "$prompt_parent" && pwd -P)
+ prompt_root=$(mktemp -d "$prompt_parent/dotfiles-fish-prompt.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$prompt_root" "$prompt_parent" dotfiles-fish-prompt.' EXIT HUP INT TERM
+
+ prompt_home="$prompt_root/home"
+ prompt_repo="$prompt_root/repo"
+ prompt_outside="$prompt_root/outside"
+ prompt_file="$repo_root/home/dot_config/fish/functions/fish_prompt.fish"
+ prompt_template="$prompt_root/git-template"
+ # Fish, not Bash, expands the two environment variables in this command.
+ # shellcheck disable=SC2016
+ prompt_command='cd "$DOTFILES_PROMPT_DIR"; source "$DOTFILES_PROMPT_FILE"; fish_prompt'
+ mkdir -p -- "$prompt_home" "$prompt_repo" "$prompt_outside" "$prompt_template"
+
+ unset \
+ GIT_COMMON_DIR \
+ GIT_CONFIG \
+ GIT_CONFIG_COUNT \
+ GIT_CONFIG_PARAMETERS \
+ GIT_DIR \
+ GIT_INDEX_FILE \
+ GIT_OBJECT_DIRECTORY \
+ GIT_WORK_TREE
+ export GIT_ATTR_NOSYSTEM=1
+ export GIT_CONFIG_GLOBAL=/dev/null
+ export GIT_CONFIG_NOSYSTEM=1
+ export GIT_NO_REPLACE_OBJECTS=1
+ export GIT_TERMINAL_PROMPT=0
+ export GIT_CONFIG_COUNT=3
+ export GIT_CONFIG_KEY_0=core.hooksPath
+ export GIT_CONFIG_VALUE_0=/dev/null
+ export GIT_CONFIG_KEY_1=core.fsmonitor
+ export GIT_CONFIG_VALUE_1=false
+ export GIT_CONFIG_KEY_2=core.attributesFile
+ export GIT_CONFIG_VALUE_2=/dev/null
+
+ git -C "$prompt_repo" -c init.defaultBranch=benchmark \
+ init --quiet --template="$prompt_template"
+ git -C "$prompt_repo" \
+ -c user.name='Dotfiles prompt test' \
+ -c user.email=prompt-test@example.invalid \
+ -c commit.gpgsign=false \
+ commit --quiet --allow-empty --no-verify -m baseline
+
+ output=$(env \
+ HOME="$prompt_home" \
+ TERM=dumb \
+ DOTFILES_PROMPT_DIR="$prompt_outside" \
+ DOTFILES_PROMPT_FILE="$prompt_file" \
+ fish --no-config -c "$prompt_command")
+ [[ $output != *' git:('* ]]
+
+ output=$(env \
+ HOME="$prompt_home" \
+ TERM=dumb \
+ DOTFILES_PROMPT_DIR="$prompt_repo" \
+ DOTFILES_PROMPT_FILE="$prompt_file" \
+ fish --no-config -c "$prompt_command")
+ [[ $output == *' git:(benchmark)'* && $output != *' * '* ]]
+
+ blob=$(printf 'staged change\n' | git -C "$prompt_repo" hash-object -w --stdin)
+ git -C "$prompt_repo" update-index --add --cacheinfo "100644,$blob,tracked"
+ output=$(env \
+ HOME="$prompt_home" \
+ TERM=dumb \
+ DOTFILES_PROMPT_DIR="$prompt_repo" \
+ DOTFILES_PROMPT_FILE="$prompt_file" \
+ fish --no-config -c "$prompt_command")
+ [[ $output == *' git:(benchmark) *'* ]]
+
+ git -C "$prompt_repo" checkout --quiet --detach
+ detached=$(git -C "$prompt_repo" rev-parse --short=7 HEAD)
+ output=$(env \
+ HOME="$prompt_home" \
+ TERM=dumb \
+ DOTFILES_PROMPT_DIR="$prompt_repo" \
+ DOTFILES_PROMPT_FILE="$prompt_file" \
+ fish --no-config -c "$prompt_command")
+ [[ $output == *" git:($detached) *"* ]]
+)
+
+check_performance_benchmark() (
+ set -euo pipefail
+
+ local output
+ output=$(
+ "$repo_root/scripts/benchmark" \
+ --samples 1 \
+ --warmups 0 \
+ --nvim-samples 1
+ )
+
+ grep -Fq 'Fish core startup:' <<<"$output"
+ grep -Fq 'Fish configured startup:' <<<"$output"
+ grep -Fq 'Prompt outside Git:' <<<"$output"
+ grep -Fq 'Prompt in small Git repo:' <<<"$output"
+ grep -Fq 'Prompt in 5k-file repo:' <<<"$output"
+ grep -Fq 'Active configured Fish integrations:' <<<"$output"
+ grep -Fq 'No absolute pass/fail budget is applied.' <<<"$output"
+)
+
+check_lua() {
+ local file
+
+ while IFS= read -r -d '' file; do
+ luac -p "$file" || return 1
+ done < <(find home/dot_config/nvim -type f -name '*.lua' -print0)
+ luac -p scripts/nvim-first-start.lua
+ luac -p scripts/nvim-preflight.lua
+}
+
+check_hsl_colors() {
+ lua - <<'LUA'
+local hsl = dofile("home/dot_config/nvim/lua/m1ngsama/hsl.lua")
+
+local function assert_close(actual, expected)
+ assert(math.abs(actual - expected) < 1e-12, ("expected %s, got %s"):format(expected, actual))
+end
+
+local short = hsl.hex_to_rgb("#abc")
+assert_close(short[1], 170 / 255)
+assert_close(short[2], 187 / 255)
+assert_close(short[3], 204 / 255)
+assert(hsl.hexToHSL("#fff") == "hsl(0, 0, 100)")
+assert(hsl.hexToHSL("#ff0000") == "hsl(0, 100, 50)")
+assert(hsl.hslToHex(0, 100, 50) == "#ff0000")
+
+local line = "short=#abc long=#112233 alpha=#11223344 malformed=#12 identifier=#abcdefg"
+local expected = "short=hsl(210, 25, 73) long=hsl(210, 50, 13) alpha=#11223344 malformed=#12 identifier=#abcdefg"
+assert(hsl.replace_hex_colors(line) == expected)
+
+for _, invalid in ipairs({ "#12", "#1234", "#1234567", "#12345678", "not-a-color" }) do
+ assert(not pcall(hsl.hex_to_rgb, invalid), "unexpectedly accepted " .. invalid)
+end
+LUA
+}
+
+check_nvim_api() {
+ DOTFILES_REPO_ROOT="$repo_root" nvim --clean --headless -u NONE \
+ --cmd 'lua local version = vim.version(); assert(version.major > 0 or version.minor >= 12)' \
+ --cmd 'lua local hsl = dofile(vim.env.DOTFILES_REPO_ROOT .. "/" .. "home/dot_config/nvim/lua/m1ngsama/hsl.lua"); assert(hsl.hexToHSL("#fff") == "hsl(0, 0, 100)")' \
+ --cmd 'lua local spec = dofile(vim.env.DOTFILES_REPO_ROOT .. "/" .. "home/dot_config/nvim/lua/plugins/treesitter.lua"); spec[1].init(); assert(vim.filetype.match({ filename = "test.mdx" }) == "mdx")' \
+ --cmd 'lua local original = vim.uv.os_uname; vim.uv.os_uname = function() return { sysname = "Linux", machine = "aarch64" } end; local spec = dofile(vim.env.DOTFILES_REPO_ROOT .. "/" .. "home/dot_config/nvim/lua/plugins/lsp.lua"); vim.uv.os_uname = original; local mason = { ensure_installed = {} }; spec[1].opts(nil, mason); assert(not vim.tbl_contains(mason.ensure_installed, "selene")); assert(not vim.tbl_contains(mason.ensure_installed, "clangd")); local lint = { linters_by_ft = {} }; spec[2].opts(nil, lint); assert(vim.deep_equal(lint.linters_by_ft.lua, { "luacheck" })); assert(spec[3].opts.servers.clangd.mason == false)' \
+ --cmd 'lua local lsp = dofile(vim.env.DOTFILES_REPO_ROOT .. "/" .. "home/dot_config/nvim/lua/m1ngsama/lsp.lua"); lsp.toggleInlayHints()' \
+ +qa
+}
+
+check_nvim_setup_lock_and_signal() (
+ set -euo pipefail
+
+ local setup_parent
+ local setup_root
+ local fake_bin
+ local owner_state
+ local owner_home
+ local owner_events
+ local owner_mkdir_marker
+ local owner_mkdir_release
+ local owner_marker
+ local owner_release
+ local owner_log
+ local contender_log
+ local owner_lock
+ local owner_pid=
+ local owner_status
+ local contender_pid=
+ local contender_status
+ local term_state
+ local term_home
+ local term_events
+ local term_marker
+ local term_release
+ local term_log
+ local term_lock
+ local term_pid=
+ local term_status
+ local term_child_pid
+ local real_mkdir
+
+ wait_for_setup_marker() {
+ local marker=$1
+ local pid=$2
+ local count
+
+ for ((count = 0; count < 300; count++)); do
+ [[ -e $marker ]] && return 0
+ kill -0 "$pid" 2>/dev/null || return 1
+ sleep 0.1
+ done
+ return 1
+ }
+
+ # shellcheck disable=SC2317,SC2329
+ cleanup_nvim_setup_test() {
+ local pid
+ local marker
+ local child_pid
+
+ for pid in "$owner_pid" "$contender_pid" "$term_pid"; do
+ [[ -n $pid ]] || continue
+ kill -TERM "$pid" 2>/dev/null || true
+ done
+ [[ -z $owner_mkdir_release ]] || : >"$owner_mkdir_release"
+ [[ -z $owner_release ]] || : >"$owner_release"
+ for pid in "$owner_pid" "$contender_pid" "$term_pid"; do
+ [[ -n $pid ]] || continue
+ wait "$pid" 2>/dev/null || true
+ done
+ for marker in "$owner_marker" "$term_marker"; do
+ [[ -f $marker ]] || continue
+ child_pid=$(<"$marker")
+ [[ $child_pid =~ ^[0-9]+$ ]] || continue
+ kill -TERM "$child_pid" 2>/dev/null || true
+ done
+ dotfiles_safe_cleanup_tree "$setup_root" "$setup_parent" dotfiles-nvim-setup-test.
+ }
+
+ # shellcheck disable=SC2317,SC2329
+ exit_nvim_setup_test_for_signal() {
+ local status=$1
+
+ trap - HUP INT TERM
+ cleanup_nvim_setup_test
+ trap - EXIT
+ exit "$status"
+ }
+
+ setup_parent=${TMPDIR:-/tmp}
+ setup_parent=$(cd -P -- "$setup_parent" && pwd -P)
+ real_mkdir=$(command -v mkdir)
+ [[ $real_mkdir == /* ]]
+ setup_root=$(mktemp -d "$setup_parent/dotfiles-nvim-setup-test.XXXXXXXX")
+ fake_bin="$setup_root/bin"
+ owner_state="$setup_root/owner-state"
+ owner_home="$setup_root/owner-home"
+ owner_events="$setup_root/owner-events"
+ owner_mkdir_marker="$setup_root/owner-lock-created"
+ owner_mkdir_release="$setup_root/owner-lock-release"
+ owner_marker="$setup_root/owner-preflight-child"
+ owner_release="$setup_root/owner-release"
+ owner_log="$setup_root/owner.log"
+ contender_log="$setup_root/contender.log"
+ owner_lock="$owner_state/nvim/dotfiles-setup.lock"
+ term_state="$setup_root/term-state"
+ term_home="$setup_root/term-home"
+ term_events="$setup_root/term-events"
+ term_marker="$setup_root/term-preflight-child"
+ term_release="$setup_root/term-release"
+ term_log="$setup_root/term.log"
+ term_lock="$term_state/nvim/dotfiles-setup.lock"
+ mkdir -p -- "$fake_bin" "$owner_home" "$term_home"
+ : >"$owner_events"
+ : >"$term_events"
+
+ trap cleanup_nvim_setup_test EXIT
+ trap 'exit_nvim_setup_test_for_signal 129' HUP
+ trap 'exit_nvim_setup_test_for_signal 130' INT
+ trap 'exit_nvim_setup_test_for_signal 143' TERM
+
+ # This fake never loads configuration or accesses the network. A preflight
+ # records its child PID and blocks until released. If a locking regression
+ # lets a second setup reach preflight, it records that violation and exits
+ # immediately instead of making the test hang.
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/usr/bin/env bash' \
+ 'set -u' \
+ 'is_preflight=0' \
+ 'for argument in "$@"; do' \
+ ' [[ $argument != --clean ]] || is_preflight=1' \
+ 'done' \
+ 'if ((is_preflight == 0)); then' \
+ ' printf "provision\\t%s\\n" "$$" >>"$DOTFILES_TEST_EVENTS"' \
+ ' exit 0' \
+ 'fi' \
+ 'printf "preflight\\t%s\\n" "$$" >>"$DOTFILES_TEST_EVENTS"' \
+ 'if [[ -e $DOTFILES_TEST_MARKER ]]; then' \
+ ' exit 91' \
+ 'fi' \
+ 'printf "%s\\n" "$$" >"$DOTFILES_TEST_MARKER"' \
+ 'on_term() {' \
+ ' printf "child-term\\t%s\\n" "$$" >>"$DOTFILES_TEST_EVENTS"' \
+ ' exit 143' \
+ '}' \
+ 'trap on_term TERM' \
+ 'for ((index = 0; index < 300; index++)); do' \
+ ' [[ ! -e $DOTFILES_TEST_RELEASE ]] || exit 0' \
+ ' sleep 0.1' \
+ 'done' \
+ 'exit 124' \
+ >"$fake_bin/nvim"
+ chmod 0755 "$fake_bin/nvim"
+
+ # Reproduce the narrow ownership window exactly: the real mkdir has created
+ # an empty setup lock, but setup-nvim has not yet observed success, marked
+ # lock_owned, or written its PID. A losing contender's EXIT cleanup must not
+ # remove that empty directory from underneath the owner.
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/usr/bin/env bash' \
+ 'set -u' \
+ 'is_setup_lock=0' \
+ 'for argument in "$@"; do' \
+ ' case $argument in' \
+ ' */dotfiles-setup.lock) is_setup_lock=1 ;;' \
+ ' esac' \
+ 'done' \
+ '"$DOTFILES_TEST_REAL_MKDIR" "$@"' \
+ 'status=$?' \
+ '((status == 0)) || exit "$status"' \
+ 'if ((is_setup_lock == 1)) && [[ -n ${DOTFILES_TEST_MKDIR_MARKER:-} ]]; then' \
+ ' : >"$DOTFILES_TEST_MKDIR_MARKER"' \
+ ' for ((index = 0; index < 300; index++)); do' \
+ ' [[ ! -e $DOTFILES_TEST_MKDIR_RELEASE ]] || exit 0' \
+ ' sleep 0.1' \
+ ' done' \
+ ' exit 124' \
+ 'fi' \
+ 'exit 0' \
+ >"$fake_bin/mkdir"
+ chmod 0755 "$fake_bin/mkdir"
+
+ PATH="$fake_bin:$PATH" \
+ HOME="$owner_home" \
+ XDG_STATE_HOME="$owner_state" \
+ DOTFILES_TEST_EVENTS="$owner_events" \
+ DOTFILES_TEST_REAL_MKDIR="$real_mkdir" \
+ DOTFILES_TEST_MKDIR_MARKER="$owner_mkdir_marker" \
+ DOTFILES_TEST_MKDIR_RELEASE="$owner_mkdir_release" \
+ DOTFILES_TEST_MARKER="$owner_marker" \
+ DOTFILES_TEST_RELEASE="$owner_release" \
+ "$repo_root/scripts/setup-nvim" >"$owner_log" 2>&1 &
+ owner_pid=$!
+ wait_for_setup_marker "$owner_mkdir_marker" "$owner_pid"
+ [[ -d $owner_lock && ! -e $owner_lock/pid && ! -L $owner_lock/pid ]]
+ [[ -z $(find "$owner_lock" -mindepth 1 -maxdepth 1 -print -quit) ]]
+ [[ ! -s $owner_events ]]
+
+ PATH="$fake_bin:$PATH" \
+ HOME="$owner_home" \
+ XDG_STATE_HOME="$owner_state" \
+ DOTFILES_TEST_EVENTS="$owner_events" \
+ DOTFILES_TEST_REAL_MKDIR="$real_mkdir" \
+ DOTFILES_TEST_MKDIR_MARKER="$owner_mkdir_marker" \
+ DOTFILES_TEST_MKDIR_RELEASE="$owner_mkdir_release" \
+ DOTFILES_TEST_MARKER="$owner_marker" \
+ DOTFILES_TEST_RELEASE="$owner_release" \
+ "$repo_root/scripts/setup-nvim" >"$contender_log" 2>&1 &
+ contender_pid=$!
+ if wait "$contender_pid"; then
+ contender_status=0
+ else
+ contender_status=$?
+ fi
+ contender_pid=
+
+ [[ $contender_status != 0 ]]
+ [[ -d $owner_lock && ! -e $owner_lock/pid && ! -L $owner_lock/pid ]]
+ [[ -z $(find "$owner_lock" -mindepth 1 -maxdepth 1 -print -quit) ]]
+ [[ ! -s $owner_events ]]
+ grep -Fq 'Another Neovim setup may be active' "$contender_log"
+
+ : >"$owner_mkdir_release"
+ wait_for_setup_marker "$owner_marker" "$owner_pid"
+ [[ -d $owner_lock && -f $owner_lock/pid ]]
+ [[ $(<"$owner_lock/pid") == "$owner_pid" ]]
+ [[ $(grep -c '^preflight' "$owner_events") == 1 ]]
+
+ : >"$owner_release"
+ if wait "$owner_pid"; then
+ owner_status=0
+ else
+ owner_status=$?
+ fi
+ owner_pid=
+
+ [[ $owner_status == 0 ]]
+ [[ $(grep -c '^preflight' "$owner_events") == 1 ]]
+ [[ $(grep -c '^provision' "$owner_events") == 1 ]]
+ [[ ! -e $owner_lock && ! -L $owner_lock ]]
+
+ PATH="$fake_bin:$PATH" \
+ HOME="$term_home" \
+ XDG_STATE_HOME="$term_state" \
+ DOTFILES_TEST_EVENTS="$term_events" \
+ DOTFILES_TEST_REAL_MKDIR="$real_mkdir" \
+ DOTFILES_TEST_MARKER="$term_marker" \
+ DOTFILES_TEST_RELEASE="$term_release" \
+ "$repo_root/scripts/setup-nvim" >"$term_log" 2>&1 &
+ term_pid=$!
+ wait_for_setup_marker "$term_marker" "$term_pid"
+ term_child_pid=$(<"$term_marker")
+ [[ $term_child_pid =~ ^[0-9]+$ ]]
+ kill -0 "$term_child_pid"
+ [[ -d $term_lock && -f $term_lock/pid ]]
+ [[ $(<"$term_lock/pid") == "$term_pid" ]]
+
+ kill -TERM "$term_pid"
+ if wait "$term_pid"; then
+ term_status=0
+ else
+ term_status=$?
+ fi
+ term_pid=
+
+ [[ $term_status == 143 ]]
+ grep -Fqx $'child-term\t'"$term_child_pid" "$term_events"
+ if kill -0 "$term_child_pid" 2>/dev/null; then
+ return 1
+ fi
+ [[ ! -e $term_lock && ! -L $term_lock ]]
+ if grep -Fq $'provision\t' "$term_events" ||
+ grep -Fq 'Provisioning the reviewed plugin and toolchain graph' "$term_log"; then
+ return 1
+ fi
+)
+
+check_nvim_preflight_integrity() (
+ set -euo pipefail
+
+ local preflight_parent
+ local preflight_root
+ local baseline
+ local base_commit
+ local config_root
+ local lazy_root
+ local hook
+ local marker
+ local preflight_log
+ local replacement_commit
+ local case_name
+ local -a quarantined_cases
+
+ preflight_parent=${TMPDIR:-/tmp}
+ preflight_parent=$(cd -P -- "$preflight_parent" && pwd -P)
+ preflight_root=$(mktemp -d "$preflight_parent/dotfiles-nvim-preflight.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$preflight_root" "$preflight_parent" dotfiles-nvim-preflight.' EXIT HUP INT TERM
+
+ baseline="$preflight_root/baseline"
+ config_root="$preflight_root/config/nvim"
+ lazy_root="$preflight_root/data/nvim/lazy"
+ hook="$preflight_root/untrusted-filter"
+ marker="$preflight_root/untrusted-command-executed"
+ preflight_log="$preflight_root/preflight.log"
+ quarantined_cases=(
+ filter-metadata
+ gitlink
+ ignored-code
+ info-exclude
+ replace-ref
+ skip-index
+ stat-config
+ worktree-config
+ )
+
+ mkdir -p -- "$baseline" "$config_root" "$lazy_root" "$preflight_root/home"
+ git -C "$baseline" init --quiet
+ printf 'return { trusted = true }\n' >"$baseline/plugin.lua"
+ printf 'build/\n' >"$baseline/.gitignore"
+ git -C "$baseline" add -- plugin.lua .gitignore
+ git -C "$baseline" \
+ -c user.name='dotfiles canary' \
+ -c user.email='dotfiles-canary@example.invalid' \
+ commit --quiet -m baseline
+ base_commit=$(git -C "$baseline" rev-parse HEAD)
+
+ cp -R -- "$baseline" "$lazy_root/control"
+ for case_name in "${quarantined_cases[@]}"; do
+ cp -R -- "$baseline" "$lazy_root/$case_name"
+ done
+
+ mkdir -p -- "$preflight_root/external-worktree"
+ cp -- "$baseline/plugin.lua" "$preflight_root/external-worktree/plugin.lua"
+ cp -- "$baseline/.gitignore" "$preflight_root/external-worktree/.gitignore"
+ git -C "$lazy_root/worktree-config" config core.worktree "$preflight_root/external-worktree"
+
+ # The literal variable is expanded only if an unsafe Git metadata command
+ # executes. A safe preflight must quarantine this checkout first.
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/bin/sh' \
+ ': >"$DOTFILES_NVIM_PREFLIGHT_MARKER"' \
+ 'cat' \
+ >"$hook"
+ chmod 700 "$hook"
+ git -C "$lazy_root/filter-metadata" config filter.dotfiles-canary.clean "$hook"
+ printf '*.lua filter=dotfiles-canary\n' \
+ >"$lazy_root/filter-metadata/.git/info/attributes"
+ printf 'return { trusted = false }\n' >"$lazy_root/filter-metadata/plugin.lua"
+
+ printf 'hidden.lua\n' >>"$lazy_root/info-exclude/.git/info/exclude"
+ printf 'return { hidden = true }\n' >"$lazy_root/info-exclude/hidden.lua"
+
+ replacement_commit=$(
+ printf 'replacement metadata\n' |
+ git -C "$lazy_root/replace-ref" \
+ -c user.name='dotfiles canary' \
+ -c user.email='dotfiles-canary@example.invalid' \
+ commit-tree "${base_commit}^{tree}" -p "$base_commit"
+ )
+ git -C "$lazy_root/replace-ref" replace "$base_commit" "$replacement_commit"
+
+ printf 'return { trusted = false }\n' >"$lazy_root/skip-index/plugin.lua"
+ git -C "$lazy_root/skip-index" update-index --skip-worktree plugin.lua
+
+ git -C "$lazy_root/stat-config" config core.trustctime false
+ git -C "$lazy_root/stat-config" config core.checkStat minimal
+
+ mkdir -p -- "$lazy_root/ignored-code/build"
+ printf 'return { ignored = true }\n' >"$lazy_root/ignored-code/build/plugin.lua"
+
+ git -C "$lazy_root/gitlink" update-index \
+ --add --cacheinfo "160000,$base_commit,nested"
+ git -C "$lazy_root/gitlink" \
+ -c user.name='dotfiles canary' \
+ -c user.email='dotfiles-canary@example.invalid' \
+ commit --quiet -m gitlink
+
+ DOTFILES_NVIM_PREFLIGHT_LAZY_ROOT="$lazy_root" \
+ DOTFILES_NVIM_PREFLIGHT_CONFIG="$config_root/lazy-lock.json" \
+ python3 - <<'PY'
+import json
+import os
+import pathlib
+import subprocess
+
+root = pathlib.Path(os.environ["DOTFILES_NVIM_PREFLIGHT_LAZY_ROOT"])
+lock = {}
+for checkout in sorted(path for path in root.iterdir() if path.is_dir()):
+ commit = subprocess.check_output(
+ ["git", "--no-replace-objects", "-C", str(checkout), "rev-parse", "HEAD"],
+ text=True,
+ ).strip()
+ lock[checkout.name] = {"branch": "main", "commit": commit}
+pathlib.Path(os.environ["DOTFILES_NVIM_PREFLIGHT_CONFIG"]).write_text(
+ json.dumps(lock, indent=2, sort_keys=True) + "\n",
+ encoding="utf-8",
+)
+PY
+
+ env \
+ DOTFILES_NVIM_PREFLIGHT_MARKER="$marker" \
+ DOTFILES_NVIM_PREFLIGHT_SCRIPT="$repo_root/scripts/nvim-preflight.lua" \
+ HOME="$preflight_root/home" \
+ NVIM_APPNAME=nvim \
+ XDG_CONFIG_HOME="$preflight_root/config" \
+ XDG_DATA_HOME="$preflight_root/data" \
+ XDG_STATE_HOME="$preflight_root/state" \
+ nvim --clean --headless -u NONE \
+ '+lua dofile(vim.env.DOTFILES_NVIM_PREFLIGHT_SCRIPT)' +qa \
+ >"$preflight_log" 2>&1
+
+ [[ -d $lazy_root/control ]]
+ [[ ! -e $marker && ! -L $marker ]]
+ for case_name in "${quarantined_cases[@]}"; do
+ [[ ! -e $lazy_root/$case_name && ! -L $lazy_root/$case_name ]]
+ [[ -n $(find "$preflight_root/data/nvim/dotfiles-quarantine" \
+ -mindepth 2 -maxdepth 2 -type d -name "$case_name" -print -quit) ]]
+ grep -Fq "Quarantined Neovim plugin $case_name:" "$preflight_log"
+ done
+)
+
+check_nvim_bootstrap() (
+ set -euo pipefail
+
+ local bootstrap_parent
+ local bootstrap_root
+ local expected_commit
+ local expected_lazyvim_commit
+ local installed_commit
+ local lazy_path
+ local lazyvim_path
+ local lock_probe
+ local nvim_log
+
+ bootstrap_parent=${TMPDIR:-/tmp}
+ bootstrap_parent=$(cd -P -- "$bootstrap_parent" && pwd -P)
+ bootstrap_root=$(mktemp -d "$bootstrap_parent/dotfiles-nvim-bootstrap.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$bootstrap_root" "$bootstrap_parent" dotfiles-nvim-bootstrap.' EXIT HUP INT TERM
+
+ lazy_path="$bootstrap_root/data/nvim/lazy/lazy.nvim"
+ lazyvim_path="$bootstrap_root/data/nvim/lazy/LazyVim"
+ lock_probe="$bootstrap_root/lazy-lock.json"
+ nvim_log="$bootstrap_root/nvim.log"
+ expected_commit=$(jq -er '."lazy.nvim".commit' home/dot_config/nvim/lazy-lock.json)
+ expected_lazyvim_commit=$(jq -er '.LazyVim.commit' home/dot_config/nvim/lazy-lock.json)
+ printf '{}\n' >"$lock_probe"
+
+ # Exercise the repository's real bootstrap without resolving the full plugin
+ # graph. The second process then makes lazy.nvim write a minimal lock so a
+ # missing origin/HEAD cannot silently truncate the deployed lock on day one.
+ env \
+ DOTFILES_REPO_ROOT="$repo_root" \
+ NVIM_APPNAME=nvim \
+ XDG_CACHE_HOME="$bootstrap_root/cache" \
+ XDG_CONFIG_HOME="$bootstrap_root/config" \
+ XDG_DATA_HOME="$bootstrap_root/data" \
+ XDG_STATE_HOME="$bootstrap_root/state" \
+ nvim --clean --headless -u NONE \
+ --cmd 'lua package.preload["lazy"] = function() return { setup = function() end } end' \
+ --cmd 'lua local ok, err = pcall(dofile, vim.env.DOTFILES_REPO_ROOT .. "/" .. "home/dot_config/nvim/lua/config/lazy.lua"); if not ok then vim.api.nvim_err_writeln(err); vim.cmd("cquit 1") end' \
+ +qa >"$nvim_log" 2>&1
+
+ installed_commit=$(git -C "$lazy_path" rev-parse HEAD)
+ [[ $installed_commit == "$expected_commit" ]]
+ [[ $(git -C "$lazy_path" symbolic-ref refs/remotes/origin/HEAD) == refs/remotes/origin/main ]]
+ [[ $(git -C "$lazy_path" rev-parse refs/remotes/origin/main) == "$expected_commit" ]]
+ [[ $(git -C "$lazyvim_path" rev-parse HEAD) == "$expected_lazyvim_commit" ]]
+ [[ $(git -C "$lazyvim_path" symbolic-ref refs/remotes/origin/HEAD) == refs/remotes/origin/main ]]
+ [[ $(git -C "$lazyvim_path" rev-parse refs/remotes/origin/main) == "$expected_lazyvim_commit" ]]
+
+ env \
+ DOTFILES_LAZY_PATH="$lazy_path" \
+ DOTFILES_LOCK_PROBE="$lock_probe" \
+ NVIM_APPNAME=nvim \
+ nvim --clean --headless -u NONE \
+ --cmd 'lua vim.opt.rtp:prepend(vim.env.DOTFILES_LAZY_PATH)' \
+ --cmd 'lua local ok, err = pcall(function() require("lazy").setup({ spec = {{ "folke/lazy.nvim" }}, root = vim.fn.fnamemodify(vim.env.DOTFILES_LAZY_PATH, ":h"), lockfile = vim.env.DOTFILES_LOCK_PROBE, install = { missing = false }, checker = { enabled = false }, change_detection = { enabled = false } }); require("lazy.manage.lock").update() end); if not ok then vim.api.nvim_err_writeln(err); vim.cmd("cquit 1") end' \
+ +qa >>"$nvim_log" 2>&1
+
+ jq -e \
+ --arg commit "$expected_commit" \
+ 'keys == ["lazy.nvim"] and ."lazy.nvim" == {"branch":"main", "commit":$commit}' \
+ "$lock_probe" >/dev/null
+ ! grep -Eq 'E[0-9]{3,}|assertion failed|bootstrap failed' "$nvim_log"
+)
+
+check_nvim_first_start() (
+ set -euo pipefail
+
+ local canary_parent
+ local canary_root
+ local drift_marker
+ local fsmonitor_hook
+ local git_template
+ local global_attributes
+ local lazy_root
+ local lazyvim_init
+ local lualine_init
+ local nvim_log
+ local nvim_error_pattern
+ local post_checkout_hook
+ local quarantine_root
+ local theme_init
+
+ canary_parent=${TMPDIR:-/tmp}
+ canary_parent=$(cd -P -- "$canary_parent" && pwd -P)
+ canary_root=$(mktemp -d "$canary_parent/dotfiles-nvim-first-start.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$canary_root" "$canary_parent" dotfiles-nvim-first-start.' EXIT HUP INT TERM
+
+ mkdir -p -- "$canary_root/config" "$canary_root/home" "$canary_root/state"
+ cp -R -- home/dot_config/nvim "$canary_root/config/nvim"
+ nvim_log="$canary_root/nvim.log"
+ lazy_root="$canary_root/data/nvim/lazy"
+ quarantine_root="$canary_root/data/nvim/dotfiles-quarantine"
+ drift_marker="$canary_root/old-plugin-code-executed"
+ fsmonitor_hook="$canary_root/untrusted-fsmonitor"
+ git_template="$canary_root/untrusted-git-template"
+ global_attributes="$canary_root/untrusted-global-attributes"
+ post_checkout_hook="$lazy_root/plenary.nvim/.git/hooks/post-checkout"
+ nvim_error_pattern='Package is already installing|Failed to run .(init|config).|installation was aborted|Neovim is exiting while packages are still installing|Terminating all installations|lazy task failed|Mason package .* did not converge|E[0-9]{3,}|bootstrap failed|timed out waiting'
+
+ # A cold clone must not execute content-changing or executable inputs from
+ # the caller's personal Git configuration. If setup-nvim fails to install
+ # its controlled Git view, this hook/filter both leaves an observable marker
+ # and corrupts checked-out Lua, making the canary fail closed.
+ mkdir -p -- "$git_template/hooks"
+ # The canary expands this variable only when Git invokes it.
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/bin/sh' \
+ ': >"$DOTFILES_NVIM_DRIFT_MARKER"' \
+ "printf 'canary-token\\n'" \
+ >"$fsmonitor_hook"
+ chmod 700 "$fsmonitor_hook"
+ cp -- "$fsmonitor_hook" "$git_template/hooks/post-checkout"
+ chmod 700 "$git_template/hooks/post-checkout"
+ printf '*.lua filter=dotfiles-canary\n' >"$global_attributes"
+ git config --file "$canary_root/home/.gitconfig" core.hooksPath "$git_template/hooks"
+ git config --file "$canary_root/home/.gitconfig" init.templateDir "$git_template"
+ git config --file "$canary_root/home/.gitconfig" core.attributesFile "$global_attributes"
+ git config --file "$canary_root/home/.gitconfig" filter.dotfiles-canary.clean "$fsmonitor_hook"
+ git config --file "$canary_root/home/.gitconfig" filter.dotfiles-canary.smudge "$fsmonitor_hook"
+
+ if ! env \
+ DOTFILES_NVIM_DRIFT_MARKER="$drift_marker" \
+ DOTFILES_NVIM_PREFLIGHT_SCRIPT=/definitely/missing-preflight.lua \
+ DOTFILES_NVIM_SETUP_SCRIPT=/definitely/missing-setup.lua \
+ GIT_CONFIG_COUNT=1 \
+ GIT_CONFIG_KEY_0=core.fsmonitor \
+ GIT_CONFIG_VALUE_0=/definitely/missing-fsmonitor \
+ GIT_DIR=/definitely/missing-git-dir \
+ GIT_INDEX_FILE=/definitely/missing-git-index \
+ GIT_TERMINAL_PROMPT=0 \
+ GIT_TEMPLATE_DIR=/definitely/missing-git-template \
+ GIT_WORK_TREE=/definitely/missing-git-worktree \
+ GOFLAGS=-modcacherw \
+ HOME="$canary_root/home" \
+ NVIM_APPNAME=caller-value-must-not-win \
+ XDG_CACHE_HOME="$canary_root/cache" \
+ XDG_CONFIG_HOME="$canary_root/config" \
+ XDG_DATA_HOME="$canary_root/data" \
+ XDG_STATE_HOME="$canary_root/state" \
+ "$repo_root/scripts/setup-nvim" \
+ >"$nvim_log" 2>&1; then
+ tail -n 200 "$nvim_log" >&2
+ return 1
+ fi
+
+ if [[ -e $drift_marker || -L $drift_marker ]]; then
+ printf 'personal Git configuration executed during a cold Neovim clone\n' >&2
+ return 1
+ fi
+
+ if grep -Eq "$nvim_error_pattern" "$nvim_log"; then
+ grep -En "$nvim_error_pattern" "$nvim_log" >&2
+ return 1
+ fi
+
+ cmp -- \
+ home/dot_config/nvim/lazy-lock.json \
+ "$canary_root/config/nvim/lazy-lock.json" || return 1
+
+ # Exercise both drift classes before a real config can load them: a clean
+ # manager commit mismatch, a clean LazyVim commit containing an observable
+ # startup side effect, and a dirty start-plugin checkout with the same side
+ # effect. The clean preflight must quarantine all three, preserve them, and
+ # let the single normal process install exact locked checkouts.
+ git -C "$lazy_root/lazy.nvim" \
+ -c user.name='dotfiles canary' \
+ -c user.email='dotfiles-canary@example.invalid' \
+ commit --quiet --allow-empty -m 'canary manager drift' || return 1
+
+ lazyvim_init="$lazy_root/LazyVim/lua/lazyvim/config/init.lua"
+ printf '\nvim.fn.writefile({ "executed" }, vim.env.DOTFILES_NVIM_DRIFT_MARKER)\n' \
+ >>"$lazyvim_init"
+ git -C "$lazy_root/LazyVim" add -- lua/lazyvim/config/init.lua || return 1
+ git -C "$lazy_root/LazyVim" \
+ -c user.name='dotfiles canary' \
+ -c user.email='dotfiles-canary@example.invalid' \
+ commit --quiet -m 'canary LazyVim drift' || return 1
+
+ theme_init="$lazy_root/solarized-osaka.nvim/lua/solarized-osaka/init.lua"
+ printf '\nvim.fn.writefile({ "executed" }, vim.env.DOTFILES_NVIM_DRIFT_MARKER)\n' \
+ >>"$theme_init"
+ git -C "$lazy_root/solarized-osaka.nvim" \
+ update-index --skip-worktree lua/solarized-osaka/init.lua || return 1
+
+ lualine_init="$lazy_root/lualine.nvim/lua/lualine.lua"
+ printf '\nvim.fn.writefile({ "executed" }, vim.env.DOTFILES_NVIM_DRIFT_MARKER)\n' \
+ >>"$lualine_init"
+ # Git metadata is outside the worktree. Keep this checkout exact and clean,
+ # but give it two executable metadata channels. Preflight must quarantine
+ # unsupported metadata before either channel can execute.
+ git -C "$lazy_root/plenary.nvim" config core.fsmonitor "$fsmonitor_hook" || return 1
+ cp -- "$fsmonitor_hook" "$post_checkout_hook"
+ chmod 700 "$post_checkout_hook"
+
+ if ! env \
+ DOTFILES_NVIM_DRIFT_MARKER="$drift_marker" \
+ GIT_TERMINAL_PROMPT=0 \
+ GOFLAGS=-modcacherw \
+ HOME="$canary_root/home" \
+ NVIM_APPNAME=caller-value-must-not-win \
+ XDG_CACHE_HOME="$canary_root/cache" \
+ XDG_CONFIG_HOME="$canary_root/config" \
+ XDG_DATA_HOME="$canary_root/data" \
+ XDG_STATE_HOME="$canary_root/state" \
+ "$repo_root/scripts/setup-nvim" \
+ >>"$nvim_log" 2>&1; then
+ tail -n 200 "$nvim_log" >&2
+ return 1
+ fi
+ if grep -Eq "$nvim_error_pattern" "$nvim_log"; then
+ grep -En "$nvim_error_pattern" "$nvim_log" >&2
+ return 1
+ fi
+ if [[ -e $drift_marker || -L $drift_marker ]]; then
+ printf 'a drifted Neovim plugin executed before quarantine\n' >&2
+ return 1
+ fi
+ grep -Fq 'Quarantined Neovim plugin lazy.nvim:' "$nvim_log" || return 1
+ grep -Fq 'Quarantined Neovim plugin LazyVim:' "$nvim_log" || return 1
+ grep -Fq 'Quarantined Neovim plugin lualine.nvim:' "$nvim_log" || return 1
+ grep -Fq 'Quarantined Neovim plugin plenary.nvim:' "$nvim_log" || return 1
+ grep -Fq 'Quarantined Neovim plugin solarized-osaka.nvim:' "$nvim_log" || return 1
+ [[ -n $(find "$quarantine_root" -mindepth 2 -maxdepth 2 -type d -name lazy.nvim -print -quit) ]] || return 1
+ [[ -n $(find "$quarantine_root" -mindepth 2 -maxdepth 2 -type d -name LazyVim -print -quit) ]] || return 1
+ [[ -n $(find "$quarantine_root" -mindepth 2 -maxdepth 2 -type d -name lualine.nvim -print -quit) ]] || return 1
+ [[ -n $(find "$quarantine_root" -mindepth 2 -maxdepth 2 -type d -name plenary.nvim -print -quit) ]] || return 1
+ [[ -n $(find "$quarantine_root" -mindepth 2 -maxdepth 2 -type d -name solarized-osaka.nvim -print -quit) ]] || return 1
+ [[ ! -e $canary_root/state/nvim/dotfiles-setup.lock ]] || return 1
+
+ cmp -- \
+ home/dot_config/nvim/lazy-lock.json \
+ "$canary_root/config/nvim/lazy-lock.json" || return 1
+
+ DOTFILES_NVIM_CANARY_ROOT="$canary_root" python3 - <<'PY'
+import json
+import os
+import pathlib
+import platform
+import subprocess
+
+root = pathlib.Path(os.environ["DOTFILES_NVIM_CANARY_ROOT"])
+lock = json.loads(
+ pathlib.Path("home/dot_config/nvim/lazy-lock.json").read_text(encoding="utf-8")
+)
+plugins = root / "data" / "nvim" / "lazy"
+missing = []
+wrong = []
+gitlinks = []
+for name, entry in sorted(lock.items()):
+ path = plugins / name
+ if not path.is_dir():
+ missing.append(name)
+ continue
+ head = subprocess.check_output(
+ ["git", "-C", str(path), "rev-parse", "HEAD"], text=True
+ ).strip()
+ if head != entry["commit"]:
+ wrong.append((name, entry["commit"], head))
+ staged = subprocess.check_output(
+ ["git", "-C", str(path), "ls-files", "-s"], text=True
+ ).splitlines()
+ if any(line.startswith("160000 ") for line in staged):
+ gitlinks.append(name)
+
+if missing or wrong or gitlinks:
+ raise SystemExit(
+ f"missing plugins: {missing}; wrong plugin commits: {wrong}; "
+ f"unverified gitlinks: {gitlinks}"
+ )
+
+mason_packages = root / "data" / "nvim" / "mason" / "packages"
+package_dirs = sorted(path for path in mason_packages.iterdir() if path.is_dir())
+without_receipts = [path.name for path in package_dirs if not (path / "mason-receipt.json").is_file()]
+linux_arm64 = platform.system() == "Linux" and platform.machine() in {"aarch64", "arm64"}
+expected_packages = 16 if linux_arm64 else 18
+if len(package_dirs) != expected_packages or without_receipts:
+ raise SystemExit(
+ f"expected {expected_packages} complete Mason packages; found {len(package_dirs)}; "
+ f"missing receipts: {without_receipts}"
+ )
+PY
+)
+
+check_json() {
+ jq empty \
+ home/dot_config/nvim/lazy-lock.json \
+ home/dot_config/nvim/lazyvim.json
+}
+
+check_nvim_lock() {
+ python3 - <<'PY'
+import json
+import pathlib
+import re
+
+lock_path = pathlib.Path("home/dot_config/nvim/lazy-lock.json")
+lock = json.loads(lock_path.read_text(encoding="utf-8"))
+if not isinstance(lock, dict) or len(lock) != 50:
+ raise SystemExit(f"expected exactly 50 locked Neovim plugins, found {len(lock)}")
+
+for name, entry in sorted(lock.items()):
+ if not isinstance(entry, dict):
+ raise SystemExit(f"invalid lock entry for {name}")
+ branch = entry.get("branch")
+ commit = entry.get("commit")
+ if not isinstance(branch, str) or not branch:
+ raise SystemExit(f"missing locked branch for {name}")
+ if not isinstance(commit, str) or not re.fullmatch(r"[0-9a-f]{40}", commit):
+ raise SystemExit(f"invalid locked commit for {name}: {commit}")
+
+if lock["nvim-treesitter"]["branch"] != "main":
+ raise SystemExit("the Neovim 0.12 configuration expects nvim-treesitter main")
+lazy_bootstrap = pathlib.Path(
+ "home/dot_config/nvim/lua/config/lazy.lua"
+).read_text(encoding="utf-8")
+match = re.search(r'^local lazy_commit = "([0-9a-f]{40})"$', lazy_bootstrap, re.MULTILINE)
+if not match or match.group(1) != lock["lazy.nvim"]["commit"]:
+ raise SystemExit("lazy.nvim bootstrap commit does not match lazy-lock.json")
+lazyvim_match = re.search(r'^local lazyvim_commit = "([0-9a-f]{40})"$', lazy_bootstrap, re.MULTILINE)
+if not lazyvim_match or lazyvim_match.group(1) != lock["LazyVim"]["commit"]:
+ raise SystemExit("LazyVim bootstrap commit does not match lazy-lock.json")
+if "local benchmark = vim.g.dotfiles_benchmark == 1" not in lazy_bootstrap:
+ raise SystemExit("Neovim benchmark mode is not declared before lazy setup")
+if "install = { missing = not benchmark }" not in lazy_bootstrap:
+ raise SystemExit("Neovim benchmark mode no longer disables missing-plugin installation")
+if "aerial.nvim" not in lock:
+ raise SystemExit("aerial.nvim is configured but missing from the lock")
+if "render-markdown.nvim" not in lock:
+ raise SystemExit("render-markdown.nvim is configured but missing from the lock")
+mason_spec = pathlib.Path(
+ "home/dot_config/nvim/lua/plugins/lsp.lua"
+).read_text(encoding="utf-8")
+if "github:mason-org/mason-registry@2026-08-10-faulty-close" not in mason_spec:
+ raise SystemExit("the Mason registry release is not pinned")
+treesitter_spec = pathlib.Path(
+ "home/dot_config/nvim/lua/plugins/treesitter.lua"
+).read_text(encoding="utf-8")
+for label, spec in (("Mason", mason_spec), ("Treesitter", treesitter_spec)):
+ if "vim.g.dotfiles_benchmark == 1" not in spec or "opts.ensure_installed = {}" not in spec:
+ raise SystemExit(f"Neovim benchmark mode no longer disables {label} provisioning")
+for stale in (
+ "image.nvim",
+ "markdown-preview.nvim",
+ "nvim-treesitter-playground",
+ "symbols-outline.nvim",
+):
+ if stale in lock:
+ raise SystemExit(f"stale Neovim lock entry: {stale}")
+PY
+}
+
+check_toml() {
+ python3 -c \
+ 'import pathlib, sys, tomllib; [tomllib.loads(pathlib.Path(name).read_text()) for name in sys.argv[1:]]' \
+ home/dot_config/alacritty/alacritty.toml \
+ theme/solarized-osaka.toml \
+ third_party/nvm.fish/UPSTREAM.toml \
+ third_party/hsl-color/UPSTREAM.toml \
+ third_party/ranger-scope/UPSTREAM.toml
+}
+
+check_theme() {
+ python3 - <<'PY'
+import hashlib
+import json
+import math
+import pathlib
+import re
+import tomllib
+
+manifest = tomllib.loads(
+ pathlib.Path("theme/solarized-osaka.toml").read_text(encoding="utf-8")
+)
+lock = json.loads(
+ pathlib.Path("home/dot_config/nvim/lazy-lock.json").read_text(encoding="utf-8")
+)
+if manifest["revision"] != lock["solarized-osaka.nvim"]["commit"]:
+ raise SystemExit("theme manifest revision does not match the Neovim lock")
+required_provenance = {
+ "name",
+ "source",
+ "revision",
+ "license",
+ "license_path",
+ "license_sha256",
+}
+missing_provenance = required_provenance - manifest.keys()
+if missing_provenance:
+ raise SystemExit(f"theme manifest is missing provenance fields: {sorted(missing_provenance)}")
+if manifest["license"] != "Apache-2.0":
+ raise SystemExit("Solarized Osaka must retain its Apache-2.0 license")
+if manifest["source"] != "https://github.com/craftzdog/solarized-osaka.nvim":
+ raise SystemExit("theme manifest source does not match the configured plugin")
+theme_spec = pathlib.Path(
+ "home/dot_config/nvim/lua/plugins/colorscheme.lua"
+).read_text(encoding="utf-8")
+if '"craftzdog/solarized-osaka.nvim"' not in theme_spec:
+ raise SystemExit("configured Neovim theme no longer matches the manifest source")
+if manifest["license_path"] != "third_party/solarized-osaka/LICENSE":
+ raise SystemExit("theme license path must remain a repository-relative vendor path")
+license_path = pathlib.Path(manifest["license_path"])
+if not license_path.is_file():
+ raise SystemExit(f"theme license is missing: {license_path}")
+license_sha256 = hashlib.sha256(license_path.read_bytes()).hexdigest()
+if license_sha256 != manifest["license_sha256"]:
+ raise SystemExit(
+ f"theme license checksum mismatch: expected {manifest['license_sha256']}, "
+ f"found {license_sha256}"
+ )
+
+primary = manifest["primary"]
+ansi = manifest["ansi"]
+ui = manifest["ui"]
+for section in (primary, ansi, ui):
+ for name, value in section.items():
+ if name == "opacity":
+ continue
+ if not re.fullmatch(r"#[0-9a-f]{6}", value):
+ raise SystemExit(f"invalid normalized theme color: {name}={value}")
+
+alacritty = tomllib.loads(
+ pathlib.Path("home/dot_config/alacritty/alacritty.toml").read_text(encoding="utf-8")
+)
+if alacritty["colors"]["primary"] != {
+ "background": primary["background"],
+ "foreground": primary["foreground"],
+}:
+ raise SystemExit("Alacritty primary colors drifted from the manifest")
+if alacritty["colors"]["normal"] != ansi or alacritty["colors"]["bright"] != ansi:
+ raise SystemExit("Alacritty ANSI colors drifted from the manifest")
+if alacritty["window"]["opacity"] != primary["opacity"]:
+ raise SystemExit("Alacritty opacity drifted from the manifest")
+if alacritty["colors"]["transparent_background_colors"] is not False:
+ raise SystemExit("Alacritty must blend only its primary background")
+
+revision = manifest["revision"]
+paths = (
+ pathlib.Path("home/dot_config/alacritty/alacritty.toml"),
+ pathlib.Path("home/dot_config/tmux/theme.conf"),
+ pathlib.Path("home/dot_config/fish/functions/fish_prompt.fish"),
+ pathlib.Path("home/dot_config/i3/config"),
+)
+texts = {path: path.read_text(encoding="utf-8") for path in paths}
+for path, text in texts.items():
+ if revision not in text:
+ raise SystemExit(f"{path} does not identify the palette revision")
+
+fish_expected = {name: value.removeprefix("#") for name, value in ansi.items()}
+fish_actual = dict(
+ re.findall(
+ r"^\s*set -l osaka_([a-z0-9]+) ([0-9a-f]{6})$",
+ texts[pathlib.Path("home/dot_config/fish/functions/fish_prompt.fish")],
+ re.MULTILINE,
+ )
+)
+for name in ("red", "green", "yellow", "blue", "magenta", "cyan"):
+ if fish_actual.get(name) != fish_expected[name]:
+ raise SystemExit(f"Fish prompt color drifted: {name}")
+
+i3_expected = {
+ "bg": primary["background"],
+ "surface": ui["surface"],
+ "base02": ui["base02"],
+ "base01": ui["base01"],
+ "fg": primary["foreground"],
+ "base0": ui["base0"],
+ "white": ui["white"],
+ "yellow": ansi["yellow"],
+ "red": ansi["red"],
+ "blue": ansi["blue"],
+ "cyan": ansi["cyan"],
+}
+i3_actual = dict(
+ re.findall(
+ r"^set \$osaka_([a-z0-9]+) (#[0-9a-f]{6})$",
+ texts[pathlib.Path("home/dot_config/i3/config")],
+ re.MULTILINE,
+ )
+)
+if i3_actual != i3_expected:
+ raise SystemExit("i3 palette variables drifted from the manifest")
+
+tmux_text = texts[pathlib.Path("home/dot_config/tmux/theme.conf")]
+allowed_tmux_colors = {
+ primary["background"],
+ primary["foreground"],
+ *ansi.values(),
+ *ui.values(),
+}
+unknown_tmux_colors = set(re.findall(r"#[0-9a-f]{6}\b", tmux_text)) - allowed_tmux_colors
+if unknown_tmux_colors:
+ raise SystemExit(f"tmux contains colors outside the manifest: {unknown_tmux_colors}")
+tmux_values = {}
+for line in tmux_text.splitlines():
+ match = re.match(r"^set-(?:window-)?option -g ([^ ]+) '([^']*)'$", line)
+ if match:
+ tmux_values[match.group(1)] = match.group(2)
+expected_tmux_values = {
+ "mode-style": f"fg={primary['background']},bg={ansi['cyan']},bold",
+ "message-style": f"fg={ui['base2']},bg={ui['surface']}",
+ "message-command-style": f"fg={primary['background']},bg={ansi['yellow']},bold",
+ "pane-border-style": f"fg={ui['surface']},bg=default",
+ "pane-active-border-style": f"fg={ansi['blue']},bg=default",
+ "window-status-style": f"fg={primary['foreground']},bg={primary['background']}",
+ "window-status-current-style": f"fg={primary['background']},bg={ansi['blue']},bold",
+ "window-status-activity-style": f"fg={ansi['cyan']},bg={primary['background']},underscore",
+ "window-status-bell-style": f"fg={ui['white']},bg={ansi['red']},bold",
+}
+for option, expected in expected_tmux_values.items():
+ if tmux_values.get(option) != expected:
+ raise SystemExit(f"tmux {option} drifted from the manifest")
+active_red_lines = [
+ line for line in tmux_text.splitlines()
+ if ansi["red"] in line and not line.lstrip().startswith("#")
+]
+if len(active_red_lines) != 1 or "window-status-bell-style" not in active_red_lines[0]:
+ raise SystemExit("tmux must reserve red for its bell state")
+
+def relative_luminance(color):
+ channels = [int(color[index:index + 2], 16) / 255 for index in (1, 3, 5)]
+ channels = [
+ value / 12.92 if value <= 0.04045 else ((value + 0.055) / 1.055) ** 2.4
+ for value in channels
+ ]
+ return 0.2126 * channels[0] + 0.7152 * channels[1] + 0.0722 * channels[2]
+
+def contrast(left, right):
+ high, low = sorted((relative_luminance(left), relative_luminance(right)), reverse=True)
+ return (high + 0.05) / (low + 0.05)
+
+pairs = {
+ "terminal foreground": (primary["foreground"], primary["background"]),
+ "tmux message": (ui["base2"], ui["surface"]),
+ "yellow accent": (ansi["yellow"], primary["background"]),
+ "blue accent": (ansi["blue"], primary["background"]),
+ "cyan accent": (ansi["cyan"], primary["background"]),
+ "inactive text": (ui["base0"], ui["surface"]),
+ "urgent text": (ui["white"], ansi["red"]),
+}
+for label, colors in pairs.items():
+ ratio = contrast(*colors)
+ if not math.isfinite(ratio) or ratio < 4.5:
+ raise SystemExit(f"theme contrast below 4.5:1 for {label}: {ratio:.2f}")
+PY
+}
+
+check_nvm_vendor() {
+ python3 - <<'PY'
+import hashlib
+import pathlib
+import tomllib
+
+metadata_path = pathlib.Path("third_party/nvm.fish/UPSTREAM.toml")
+metadata = tomllib.loads(metadata_path.read_text(encoding="utf-8"))
+required = (
+ "name",
+ "version",
+ "source",
+ "revision",
+ "license",
+ "license_path",
+ "license_sha256",
+)
+for key in required:
+ if not isinstance(metadata.get(key), str) or not metadata[key]:
+ raise SystemExit(f"nvm.fish metadata is missing {key}")
+if len(metadata["revision"]) != 40 or len(metadata["license_sha256"]) != 64:
+ raise SystemExit("nvm.fish revision or license SHA-256 has an invalid length")
+files = metadata.get("files")
+if not isinstance(files, dict) or len(files) != 7:
+ raise SystemExit("UPSTREAM.toml must describe exactly 7 nvm.fish files")
+
+for relative, expected in sorted(files.items()):
+ relative_path = pathlib.Path(relative)
+ if (
+ relative_path.is_absolute()
+ or ".." in relative_path.parts
+ or relative_path.parts[:3] != ("home", "dot_config", "fish")
+ ):
+ raise SystemExit(f"unsafe nvm.fish metadata path: {relative}")
+
+ source_path = relative_path
+ if not source_path.is_file():
+ raise SystemExit(f"missing vendored nvm.fish file: {source_path}")
+ actual = hashlib.sha256(source_path.read_bytes()).hexdigest()
+ if actual != expected:
+ raise SystemExit(
+ f"nvm.fish checksum mismatch for {source_path}: "
+ f"expected {expected}, got {actual}"
+ )
+
+license_path = pathlib.Path(metadata["license_path"])
+if license_path.is_absolute() or ".." in license_path.parts or not license_path.is_file():
+ raise SystemExit(f"missing or unsafe nvm.fish license path: {license_path}")
+actual_license = hashlib.sha256(license_path.read_bytes()).hexdigest()
+if actual_license != metadata["license_sha256"]:
+ raise SystemExit(
+ f"nvm.fish license checksum mismatch: expected {metadata['license_sha256']}, "
+ f"got {actual_license}"
+ )
+PY
+}
+
+check_ranger_vendor() {
+ python3 - <<'PY'
+import hashlib
+import pathlib
+import tomllib
+
+metadata_path = pathlib.Path("third_party/ranger-scope/UPSTREAM.toml")
+metadata = tomllib.loads(metadata_path.read_text(encoding="utf-8"))
+deployed = metadata.get("deployed", {})
+required = (
+ "name",
+ "version",
+ "source",
+ "revision",
+ "upstream_path",
+ "upstream_sha256",
+ "license",
+ "license_path",
+ "license_sha256",
+)
+for key in required:
+ if not isinstance(metadata.get(key), str) or not metadata[key]:
+ raise SystemExit(f"ranger scope metadata is missing {key}")
+if len(metadata["revision"]) != 40 or len(metadata["upstream_sha256"]) != 64:
+ raise SystemExit("ranger scope revision or upstream SHA-256 has an invalid length")
+modifications = metadata.get("modifications")
+if not isinstance(modifications, list) or not modifications or not all(
+ isinstance(item, str) and item for item in modifications
+):
+ raise SystemExit("ranger scope modifications must be a non-empty string list")
+checks = {
+ deployed.get("path"): deployed.get("sha256"),
+ metadata.get("license_path"): metadata.get("license_sha256"),
+}
+
+for relative, expected in checks.items():
+ if not isinstance(relative, str) or not isinstance(expected, str):
+ raise SystemExit("ranger scope metadata is missing a path or SHA-256")
+ relative_path = pathlib.Path(relative)
+ if relative_path.is_absolute() or ".." in relative_path.parts:
+ raise SystemExit(f"unsafe ranger scope metadata path: {relative}")
+ if not relative_path.is_file():
+ raise SystemExit(f"missing ranger scope provenance file: {relative_path}")
+ actual = hashlib.sha256(relative_path.read_bytes()).hexdigest()
+ if actual != expected:
+ raise SystemExit(
+ f"ranger scope checksum mismatch for {relative_path}: "
+ f"expected {expected}, got {actual}"
+ )
+PY
+}
+
+check_hsl_vendor() {
+ python3 - <<'PY'
+import hashlib
+import pathlib
+import tomllib
+
+metadata_path = pathlib.Path("third_party/hsl-color/UPSTREAM.toml")
+metadata = tomllib.loads(metadata_path.read_text(encoding="utf-8"))
+deployed = metadata.get("deployed", {})
+required = (
+ "name",
+ "source",
+ "revision",
+ "upstream_path",
+ "upstream_sha256",
+ "license",
+ "license_path",
+ "license_sha256",
+ "attribution",
+)
+for key in required:
+ if not isinstance(metadata.get(key), str) or not metadata[key]:
+ raise SystemExit(f"HSL metadata is missing {key}")
+if len(metadata["revision"]) != 40 or len(metadata["upstream_sha256"]) != 64:
+ raise SystemExit("HSL revision or upstream SHA-256 has an invalid length")
+modifications = metadata.get("modifications")
+if not isinstance(modifications, list) or not modifications or not all(
+ isinstance(item, str) and item for item in modifications
+):
+ raise SystemExit("HSL modifications must be a non-empty string list")
+checks = {
+ deployed.get("path"): deployed.get("sha256"),
+ metadata.get("license_path"): metadata.get("license_sha256"),
+}
+
+for relative, expected in checks.items():
+ if not isinstance(relative, str) or not isinstance(expected, str):
+ raise SystemExit("HSL metadata is missing a path or SHA-256")
+ relative_path = pathlib.Path(relative)
+ if relative_path.is_absolute() or ".." in relative_path.parts:
+ raise SystemExit(f"unsafe HSL metadata path: {relative}")
+ if not relative_path.is_file():
+ raise SystemExit(f"missing HSL provenance file: {relative_path}")
+ actual = hashlib.sha256(relative_path.read_bytes()).hexdigest()
+ if actual != expected:
+ raise SystemExit(
+ f"HSL checksum mismatch for {relative_path}: "
+ f"expected {expected}, got {actual}"
+ )
+PY
+}
+
+check_shell() {
+ local file
+ local -a bash_files=(
+ scripts/check
+ scripts/benchmark
+ scripts/bootstrap
+ scripts/install-chezmoi
+ scripts/setup-nvim
+ scripts/backup
+ scripts/restore
+ scripts/lib/safety.bash
+ home/dot_config/ranger/executable_scope.sh
+ )
+ local -a sh_files=(
+ home/executable_dot_xinitrc
+ home/dot_xprofile
+ )
+
+ for file in "${bash_files[@]}"; do
+ bash -n "$file" || return 1
+ done
+ for file in "${sh_files[@]}"; do
+ sh -n "$file" || return 1
+ done
+}
+
+check_shellcheck() {
+ shellcheck \
+ scripts/check \
+ scripts/benchmark \
+ scripts/bootstrap \
+ scripts/install-chezmoi \
+ scripts/setup-nvim \
+ scripts/backup \
+ scripts/restore \
+ scripts/lib/safety.bash \
+ home/executable_dot_xinitrc \
+ home/dot_xprofile
+}
+
+check_tmux() (
+ set -euo pipefail
+
+ local socket="dotfiles-check-$$"
+ local conf
+ local first_snapshot
+ local second_snapshot
+ local terminal
+
+ tmux -L "$socket" -f /dev/null new-session -d -s dotfiles-check
+ trap 'tmux -L "$socket" kill-server >/dev/null 2>&1 || true' EXIT HUP INT TERM
+ for conf in home/dot_config/tmux/*.conf; do
+ tmux -L "$socket" source-file -n "$conf" >/dev/null
+ done
+
+ tmux -L "$socket" source-file "$repo_root/home/dot_config/tmux/tmux.conf"
+ [[ $(tmux -L "$socket" show-options -gv prefix) == C-t ]]
+ terminal=$(tmux -L "$socket" show-options -gv default-terminal)
+ [[ $terminal == tmux-256color || $terminal == screen-256color ]]
+ [[ $(tmux -L "$socket" show-options -gv @dotfiles_config_file) == "$repo_root/home/dot_config/tmux/tmux.conf" ]]
+ tmux -L "$socket" list-keys -T prefix | grep -F 'lazygit is not installed' >/dev/null
+
+ first_snapshot=$(
+ tmux -L "$socket" show-options -sv terminal-features
+ tmux -L "$socket" show-options -sv terminal-overrides
+ tmux -L "$socket" show-options -gv status-left
+ )
+ tmux -L "$socket" source-file "$repo_root/home/dot_config/tmux/tmux.conf"
+ second_snapshot=$(
+ tmux -L "$socket" show-options -sv terminal-features
+ tmux -L "$socket" show-options -sv terminal-overrides
+ tmux -L "$socket" show-options -gv status-left
+ )
+ [[ $first_snapshot == "$second_snapshot" ]]
+)
+
+check_i3() {
+ i3 -C -c "$repo_root/home/dot_config/i3/config" >/dev/null
+}
+
+check_ranger_scope() (
+ set -uo pipefail
+
+ local scope_parent
+ local scope_root
+ local scope_input
+ local scope_stderr
+ local scope_status
+
+ scope_parent=${TMPDIR:-/tmp}
+ scope_parent=$(cd -P -- "$scope_parent" && pwd -P)
+ scope_root=$(mktemp -d "$scope_parent/dotfiles-scope.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$scope_root" "$scope_parent" dotfiles-scope.' EXIT HUP INT TERM
+ scope_input="$scope_root/large.txt"
+
+ # One byte above HIGHLIGHT_SIZE_MAX exercises the cross-platform stat path
+ # and exits before any optional syntax highlighter is needed.
+ dd if=/dev/zero bs=262144 count=1 2>/dev/null | LC_ALL=C tr '\000' x >"$scope_input"
+ scope_stderr=$(
+ home/dot_config/ranger/executable_scope.sh \
+ "$scope_input" 80 24 "$scope_root/cache.jpg" False \
+ 2>&1 >/dev/null
+ )
+ scope_status=$?
+
+ [[ $scope_status == 2 && -z $scope_stderr ]]
+)
+
+check_ranger_font_temp() (
+ set -uo pipefail
+
+ local font_parent
+ local font_root
+ local stub_dir
+ local temp_dir
+ local font_log
+ local font_output
+ local scope_stderr
+ local scope_status
+
+ font_parent=${TMPDIR:-/tmp}
+ font_parent=$(cd -P -- "$font_parent" && pwd -P)
+ font_root=$(mktemp -d "$font_parent/dotfiles-font-preview.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$font_root" "$font_parent" dotfiles-font-preview.' EXIT HUP INT TERM
+ stub_dir="$font_root/bin"
+ temp_dir="$font_root/tmp"
+ font_log="$font_root/fontimage-path"
+ mkdir -p -- "$stub_dir" "$temp_dir"
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'printf "%s\\n" application/opentype' \
+ >"$stub_dir/file"
+ # These variables intentionally expand later inside the generated stub.
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'output=' \
+ 'while [ "$#" -gt 0 ]; do' \
+ ' if [ "$1" = -o ]; then shift; output=$1; break; fi' \
+ ' shift' \
+ 'done' \
+ '[ -n "$output" ] || exit 1' \
+ 'printf "%s\\n" "$output" > "$FONTIMAGE_LOG"' \
+ 'printf preview > "$output"' \
+ >"$stub_dir/fontimage"
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'for argument do output=$argument; done' \
+ 'printf converted > "$output"' \
+ >"$stub_dir/convert"
+ chmod 0755 "$stub_dir/file" "$stub_dir/fontimage" "$stub_dir/convert"
+ printf 'font fixture\n' >"$font_root/font.otf"
+
+ scope_stderr=$(
+ PATH="$stub_dir:/usr/bin:/bin" \
+ TMPDIR="$temp_dir" \
+ FONTIMAGE_LOG="$font_log" \
+ home/dot_config/ranger/executable_scope.sh \
+ "$font_root/font.otf" 80 24 "$font_root/cache.png" True \
+ 2>&1 >/dev/null
+ )
+ scope_status=$?
+ [[ $scope_status == 6 && -z $scope_stderr ]] || return 1
+ [[ -f $font_log && -f $font_root/cache.png ]] || return 1
+ font_output=$(<"$font_log")
+ [[ $font_output == "$temp_dir"/ranger-font-preview.*/preview.png ]] || return 1
+ [[ ! -e ${font_output%/preview.png} ]] || return 1
+)
+
+check_ranger_media_previews() (
+ set -uo pipefail
+
+ local preview_parent
+ local preview_root
+ local stub_dir
+ local minimal_dir
+ local fixture
+ local mode
+ local output
+ local stderr
+ local status
+
+ preview_parent=${TMPDIR:-/tmp}
+ preview_parent=$(cd -P -- "$preview_parent" && pwd -P)
+ preview_root=$(mktemp -d "$preview_parent/dotfiles-ranger-media.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$preview_root" "$preview_parent" dotfiles-ranger-media.' EXIT HUP INT TERM
+ stub_dir="$preview_root/bin"
+ minimal_dir="$preview_root/minimal-bin"
+ mkdir -p -- "$stub_dir" "$minimal_dir"
+
+ # The generated stubs intentionally expand their variables when executed.
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'for argument do file_path=$argument; done' \
+ 'case $file_path in' \
+ ' *.mp4) printf "%s\n" video/mp4 ;;' \
+ ' *.pdf) printf "%s\n" application/pdf ;;' \
+ ' *.png) printf "%s\n" image/png ;;' \
+ ' *) printf "%s\n" application/octet-stream ;;' \
+ 'esac' \
+ >"$stub_dir/file"
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'output=' \
+ 'while [ "$#" -gt 0 ]; do' \
+ ' if [ "$1" = -o ]; then shift; output=$1; break; fi' \
+ ' shift' \
+ 'done' \
+ '[ -n "$output" ] || exit 1' \
+ 'printf thumbnail >"$output"' \
+ >"$stub_dir/ffmpegthumbnailer"
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'for argument do output_base=$argument; done' \
+ 'printf preview >"${output_base}.jpg"' \
+ >"$stub_dir/pdftoppm"
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'printf "chafa preview\n"' \
+ >"$stub_dir/chafa"
+ for fixture in pdftotext mutool exiftool mediainfo; do
+ printf '%s\n' '#!/bin/sh' 'exit 1' >"$stub_dir/$fixture"
+ done
+ chmod 0755 \
+ "$stub_dir/file" \
+ "$stub_dir/ffmpegthumbnailer" \
+ "$stub_dir/pdftoppm" \
+ "$stub_dir/chafa" \
+ "$stub_dir/pdftotext" \
+ "$stub_dir/mutool" \
+ "$stub_dir/exiftool" \
+ "$stub_dir/mediainfo"
+ printf video >"$preview_root/movie.mp4"
+ printf pdf >"$preview_root/document.pdf"
+ printf image >"$preview_root/image.png"
+ printf font >"$preview_root/font.otf"
+
+ stderr=$(PATH="$stub_dir:/usr/bin:/bin" \
+ home/dot_config/ranger/executable_scope.sh \
+ "$preview_root/movie.mp4" 80 24 "$preview_root/video-cache.jpg" True \
+ 2>&1 >/dev/null)
+ status=$?
+ [[ $status == 6 && -z $stderr && -f $preview_root/video-cache.jpg ]] || return 1
+
+ stderr=$(PATH="$stub_dir:/usr/bin:/bin" \
+ home/dot_config/ranger/executable_scope.sh \
+ "$preview_root/document.pdf" 80 24 "$preview_root/pdf-cache.jpg" True \
+ 2>&1 >/dev/null)
+ status=$?
+ [[ $status == 6 && -z $stderr && -f $preview_root/pdf-cache.jpg ]] || return 1
+
+ for fixture in image.png movie.mp4 document.pdf; do
+ output=$(PATH="$stub_dir:/usr/bin:/bin" \
+ home/dot_config/ranger/executable_scope.sh \
+ "$preview_root/$fixture" 80 24 "$preview_root/text-cache.jpg" False \
+ 2>"$preview_root/text.stderr")
+ status=$?
+ stderr=$(<"$preview_root/text.stderr")
+ [[ $status == 4 && $output == 'chafa preview' && -z $stderr ]] || return 1
+ done
+
+ # A deliberately minimal PATH proves that every enabled media branch stays
+ # quiet when its optional commands are absent.
+ ln -s "$(command -v bash)" "$minimal_dir/bash"
+ ln -s "$(command -v tr)" "$minimal_dir/tr"
+ cp "$stub_dir/file" "$minimal_dir/file"
+ for fixture in image.png movie.mp4 document.pdf font.otf; do
+ for mode in False True; do
+ output=$(PATH="$minimal_dir" \
+ home/dot_config/ranger/executable_scope.sh \
+ "$preview_root/$fixture" 80 24 "$preview_root/missing-cache.jpg" "$mode" \
+ 2>"$preview_root/missing.stderr")
+ status=$?
+ stderr=$(<"$preview_root/missing.stderr")
+ [[ -z $stderr ]] || return 1
+ case "$fixture:$mode" in
+ image.png:True)
+ [[ $status == 7 ]] || return 1
+ ;;
+ *)
+ [[ $status == 5 && $output == *'File Type Classification'* ]] || return 1
+ ;;
+ esac
+ done
+ done
+)
+
+check_ranger_config() {
+ local config=home/dot_config/ranger/rc.conf
+
+ grep -Fxq 'set use_preview_script true' "$config"
+ grep -Fxq 'set preview_script ~/.config/ranger/scope.sh' "$config"
+ grep -Fxq 'set preview_images false' "$config"
+ grep -Fxq 'map uT shell -w if command -v trash-restore >/dev/null 2>&1; then trash-restore; else printf '\''trash-restore is unavailable\n'\'' >&2; fi' "$config"
+ if grep -Eq '^map d[tT] ' "$config"; then
+ return 1
+ fi
+ if grep -Eq '^set preview_images_method ' "$config"; then
+ return 1
+ fi
+}
+
+check_ranger_config_parse() (
+ set -euo pipefail
+
+ local parse_parent
+ local parse_root
+
+ parse_parent=${TMPDIR:-/tmp}
+ parse_parent=$(cd -P -- "$parse_parent" && pwd -P)
+ parse_root=$(mktemp -d "$parse_parent/dotfiles-ranger-parse.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$parse_root" "$parse_parent" dotfiles-ranger-parse.' EXIT HUP INT TERM
+ mkdir -p -- "$parse_root/cache" "$parse_root/data" "$parse_root/root"
+
+ python3 - \
+ "$(command -v ranger)" \
+ "$repo_root/home/dot_config/ranger" \
+ "$parse_root" <<'PY'
+import os
+import pty
+import select
+import signal
+import sys
+import time
+
+ranger, config, root = sys.argv[1:]
+argv = [
+ ranger,
+ f"--confdir={config}",
+ f"--cachedir={root}/cache",
+ f"--datadir={root}/data",
+ "--cmd=quit!",
+ f"{root}/root",
+]
+environment = os.environ.copy()
+environment.update({"HOME": f"{root}/home", "TERM": "xterm-256color"})
+
+pid, fd = pty.fork()
+if pid == 0:
+ os.execve(ranger, argv, environment)
+
+output = bytearray()
+deadline = time.monotonic() + 10
+status = None
+try:
+ while time.monotonic() < deadline:
+ ready, _, _ = select.select([fd], [], [], 0.1)
+ if ready:
+ try:
+ output.extend(os.read(fd, 65536))
+ except OSError:
+ pass
+ waited, child_status = os.waitpid(pid, os.WNOHANG)
+ if waited == pid:
+ status = child_status
+ break
+ if status is None:
+ os.killpg(pid, signal.SIGTERM)
+ time.sleep(0.2)
+ try:
+ os.killpg(pid, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ _, status = os.waitpid(pid, 0)
+finally:
+ os.close(fd)
+
+if not os.WIFEXITED(status) or os.WEXITSTATUS(status) != 0:
+ raise SystemExit("ranger did not exit cleanly after loading rc.conf")
+decoded = output.decode("utf-8", errors="replace")
+for marker in ("Error in line", "Unknown command", "Traceback"):
+ if marker in decoded:
+ raise SystemExit(f"ranger reported a configuration error: {marker}")
+PY
+)
+
+check_chezmoi_profile() (
+ set -euo pipefail
+
+ local linux_x11=$1
+ local chezmoi_executable
+ local integration_parent
+ local integration_root
+ local destination
+ local backup_parent
+ local bootstrap_log
+ local config_snapshot
+ local profile_flag
+ local profile_data
+ local managed_output
+ local dry_run_output
+ local target
+ local -a cm
+ local -a core_targets
+ local -a x11_targets
+
+ chezmoi_executable=$(command -v chezmoi)
+ [[ $chezmoi_executable == /* ]]
+
+ integration_parent=${TMPDIR:-/tmp}
+ integration_parent=$(cd -P -- "$integration_parent" && pwd -P)
+ integration_root=$(mktemp -d "$integration_parent/dotfiles-check.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$integration_root" "$integration_parent" dotfiles-check.' EXIT HUP INT TERM
+
+ destination="$integration_root/destination"
+ backup_parent="$integration_root/backups"
+ bootstrap_log="$integration_root/bootstrap.log"
+ mkdir -p -- "$destination" "$backup_parent"
+
+ if [[ $linux_x11 == true ]]; then
+ profile_flag=--linux-x11
+ profile_data=true
+ else
+ profile_flag=--no-linux-x11
+ profile_data=false
+ fi
+
+ if ! "$repo_root/scripts/bootstrap" \
+ --apply \
+ --non-interactive \
+ "$profile_flag" \
+ --destination "$destination" \
+ --backup-parent "$backup_parent" \
+ --chezmoi "$chezmoi_executable" \
+ >"$bootstrap_log" 2>&1; then
+ printf 'chezmoi bootstrap integration failed:\n' >&2
+ command cat "$bootstrap_log" >&2
+ return 1
+ fi
+
+ # Bootstrap must not regenerate and truncate valid local chezmoi settings
+ # after the first initialization.
+ printf '\n[diff]\npager = "cat"\n' >>"$destination/.config/chezmoi/chezmoi.toml"
+ config_snapshot="$integration_root/chezmoi.toml.before-preview"
+ cp "$destination/.config/chezmoi/chezmoi.toml" "$config_snapshot"
+ if ! "$repo_root/scripts/bootstrap" \
+ --non-interactive \
+ "$profile_flag" \
+ --destination "$destination" \
+ --backup-parent "$backup_parent" \
+ --chezmoi "$chezmoi_executable" \
+ >"$bootstrap_log" 2>&1; then
+ printf 'same-source chezmoi preview failed:\n' >&2
+ command cat "$bootstrap_log" >&2
+ return 1
+ fi
+ cmp "$config_snapshot" "$destination/.config/chezmoi/chezmoi.toml"
+
+ if [[ $linux_x11 == true ]]; then
+ # On Linux, non-interactive daily use without a profile flag must respect
+ # the persisted true value instead of silently overriding it to false.
+ if ! "$repo_root/scripts/bootstrap" \
+ --non-interactive \
+ --destination "$destination" \
+ --backup-parent "$backup_parent" \
+ --chezmoi "$chezmoi_executable" \
+ >"$bootstrap_log" 2>&1; then
+ printf 'persisted Linux X11 profile preview failed:\n' >&2
+ command cat "$bootstrap_log" >&2
+ return 1
+ fi
+ cmp "$config_snapshot" "$destination/.config/chezmoi/chezmoi.toml"
+ managed_output=$(
+ "$chezmoi_executable" \
+ --source "$repo_root" \
+ --destination "$destination" \
+ --config "$destination/.config/chezmoi/chezmoi.toml" \
+ --config-format toml \
+ --cache "$destination/.cache/chezmoi" \
+ --persistent-state "$destination/.local/state/chezmoi/chezmoistate.boltdb" \
+ managed --format= --include=files --path-style=relative
+ )
+ grep -Fxq '.config/i3/config' <<<"$managed_output"
+ grep -Fxq '.config/picom/picom.conf' <<<"$managed_output"
+ fi
+
+ grep -Fxq "linuxX11 = $profile_data" \
+ "$destination/.config/chezmoi/chezmoi.toml"
+
+ cm=(
+ "$chezmoi_executable"
+ --source "$repo_root"
+ --destination "$destination"
+ --config "$destination/.config/chezmoi/chezmoi.toml"
+ --config-format toml
+ --cache "$destination/.cache/chezmoi"
+ --persistent-state "$destination/.local/state/chezmoi/chezmoistate.boltdb"
+ --override-data "{\"profiles\":{\"linuxX11\":$profile_data}}"
+ --no-tty
+ )
+
+ "${cm[@]}" verify
+
+ core_targets=(
+ .config/alacritty/alacritty.toml
+ .config/fish/config.fish
+ .config/nvim/init.lua
+ .config/ranger/rc.conf
+ .config/ranger/scope.sh
+ .config/tmux/tmux.conf
+ )
+ for target in "${core_targets[@]}"; do
+ [[ -f $destination/$target ]]
+ done
+ [[ -x $destination/.config/ranger/scope.sh ]]
+ [[ ! -e $destination/.config/fish/fish_variables ]]
+
+ x11_targets=(
+ .Xmodmap
+ .Xresources
+ .xinitrc
+ .xprofile
+ .config/i3/config
+ .config/picom/picom.conf
+ )
+ if [[ $linux_x11 == true ]]; then
+ for target in "${x11_targets[@]}"; do
+ [[ -f $destination/$target ]]
+ done
+ [[ -x $destination/.xinitrc ]]
+ else
+ for target in "${x11_targets[@]}"; do
+ [[ ! -e $destination/$target && ! -L $destination/$target ]]
+ done
+ fi
+
+ dry_run_output=$("${cm[@]}" --no-pager --dry-run apply 2>&1)
+ if [[ -n $dry_run_output ]]; then
+ printf 'second chezmoi apply --dry-run was not empty:\n%s\n' "$dry_run_output" >&2
+ return 1
+ fi
+)
+
+check_chezmoi_migration_restore() (
+ set -euo pipefail
+
+ local chezmoi_executable
+ local migration_parent
+ local migration_root
+ local destination
+ local backup_parent
+ local bootstrap_log
+ local backup_dir=
+ local backup_count=0
+ local candidate
+ local original_fish
+ local original_link='../../original-tmux.conf'
+
+ chezmoi_executable=$(command -v chezmoi)
+ [[ $chezmoi_executable == /* ]]
+
+ migration_parent=${TMPDIR:-/tmp}
+ migration_parent=$(cd -P -- "$migration_parent" && pwd -P)
+ migration_root=$(mktemp -d "$migration_parent/dotfiles-migration.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$migration_root" "$migration_parent" dotfiles-migration.' EXIT HUP INT TERM
+
+ destination="$migration_root/destination"
+ backup_parent="$migration_root/backups"
+ bootstrap_log="$migration_root/bootstrap.log"
+ original_fish="$migration_root/original-fish-config"
+ mkdir -p -- "$destination/.config/fish/conf.d" "$destination/.config/tmux" "$backup_parent"
+ chmod 0700 "$destination/.config" "$destination/.config/fish"
+ printf 'pre-existing fish config\n' >"$original_fish"
+ cp "$original_fish" "$destination/.config/fish/config.fish"
+ printf 'symlink payload\n' >"$destination/original-tmux.conf"
+ ln -s "$original_link" "$destination/.config/tmux/tmux.conf"
+ printf 'legacy z plugin\n' >"$destination/.config/fish/conf.d/z.fish"
+ printf 'legacy Fisher manifest\n' >"$destination/.config/fish/fish_plugins"
+
+ # Without a TTY or explicit force, pre-existing targets must remain intact.
+ if "$repo_root/scripts/bootstrap" \
+ --apply \
+ --non-interactive \
+ --no-linux-x11 \
+ --destination "$destination" \
+ --backup-parent "$backup_parent" \
+ --chezmoi "$chezmoi_executable" \
+ >"$bootstrap_log" 2>&1; then
+ printf 'non-interactive migration unexpectedly overwrote without --force\n' >&2
+ return 1
+ fi
+ cmp "$original_fish" "$destination/.config/fish/config.fish"
+ [[ -L $destination/.config/tmux/tmux.conf ]]
+ [[ $(readlink "$destination/.config/tmux/tmux.conf") == "$original_link" ]]
+ [[ -f $destination/.config/fish/conf.d/z.fish ]]
+ [[ -f $destination/.config/fish/fish_plugins ]]
+
+ if ! "$repo_root/scripts/bootstrap" \
+ --apply \
+ --force \
+ --clean-legacy \
+ --non-interactive \
+ --no-linux-x11 \
+ --destination "$destination" \
+ --backup-parent "$backup_parent" \
+ --chezmoi "$chezmoi_executable" \
+ >"$bootstrap_log" 2>&1; then
+ printf 'forced migration bootstrap failed:\n' >&2
+ command cat "$bootstrap_log" >&2
+ return 1
+ fi
+
+ for candidate in "$backup_parent"/backup-*; do
+ [[ -d $candidate ]] || continue
+ backup_count=$((backup_count + 1))
+ if grep -Fqx $'present\t.config/fish/conf.d/z.fish' "$candidate/manifest.tsv"; then
+ backup_dir=$candidate
+ fi
+ done
+ # The safe failed attempt and the forced attempt both retain a recoverable
+ # pre-apply backup.
+ [[ $backup_count == 2 && -n $backup_dir ]]
+ grep -Fqx $'present\t.config/fish/config.fish' "$backup_dir/manifest.tsv"
+ grep -Fqx $'present\t.config/tmux/tmux.conf' "$backup_dir/manifest.tsv"
+ grep -Fqx $'present\t.config/fish/conf.d/z.fish' "$backup_dir/manifest.tsv"
+ grep -Fqx $'present\t.config/fish/fish_plugins' "$backup_dir/manifest.tsv"
+ grep -Fqx $'directory\t.config\t700' "$backup_dir/manifest.tsv"
+ grep -Fqx $'directory\t.config/fish\t700' "$backup_dir/manifest.tsv"
+ cmp "$repo_root/home/dot_config/fish/config.fish" "$destination/.config/fish/config.fish"
+ [[ ! -L $destination/.config/tmux/tmux.conf ]]
+ [[ ! -e $destination/.config/fish/conf.d/z.fish ]]
+ [[ ! -e $destination/.config/fish/fish_plugins ]]
+
+ # Preview is read-only and the first apply restore keeps newly-created files.
+ "$repo_root/scripts/restore" "$backup_dir" >"$migration_root/restore-preview.log" 2>&1
+ cmp "$repo_root/home/dot_config/fish/config.fish" "$destination/.config/fish/config.fish"
+ "$repo_root/scripts/restore" --apply "$backup_dir" >"$migration_root/restore-apply.log" 2>&1
+ cmp "$original_fish" "$destination/.config/fish/config.fish"
+ [[ -L $destination/.config/tmux/tmux.conf ]]
+ [[ $(readlink "$destination/.config/tmux/tmux.conf") == "$original_link" ]]
+ [[ -f $destination/.config/nvim/init.lua ]]
+ grep -Fqx 'legacy z plugin' "$destination/.config/fish/conf.d/z.fish"
+ grep -Fqx 'legacy Fisher manifest' "$destination/.config/fish/fish_plugins"
+ [[ $(python3 -c 'import os, stat, sys; print(format(stat.S_IMODE(os.stat(sys.argv[1]).st_mode), "o"))' "$destination/.config") == 700 ]]
+ [[ $(python3 -c 'import os, stat, sys; print(format(stat.S_IMODE(os.stat(sys.argv[1]).st_mode), "o"))' "$destination/.config/fish") == 700 ]]
+
+ # Removing first-created targets is a separate, explicit restore operation.
+ "$repo_root/scripts/restore" --apply --remove-created "$backup_dir" \
+ >"$migration_root/restore-remove-created.log" 2>&1
+ cmp "$original_fish" "$destination/.config/fish/config.fish"
+ [[ -L $destination/.config/tmux/tmux.conf ]]
+ [[ $(readlink "$destination/.config/tmux/tmux.conf") == "$original_link" ]]
+ [[ ! -e $destination/.config/nvim/init.lua ]]
+ grep -Fqx 'legacy z plugin' "$destination/.config/fish/conf.d/z.fish"
+ grep -Fqx 'legacy Fisher manifest' "$destination/.config/fish/fish_plugins"
+ [[ $(python3 -c 'import os, stat, sys; print(format(stat.S_IMODE(os.stat(sys.argv[1]).st_mode), "o"))' "$destination/.config") == 700 ]]
+ [[ $(python3 -c 'import os, stat, sys; print(format(stat.S_IMODE(os.stat(sys.argv[1]).st_mode), "o"))' "$destination/.config/fish") == 700 ]]
+)
+
+check_chezmoi_interactive_cancel() (
+ set -euo pipefail
+
+ local chezmoi_executable
+ local cancel_parent
+ local cancel_root
+ local destination
+ local backup_parent
+ local cancel_log
+ local original_fish
+
+ chezmoi_executable=$(command -v chezmoi)
+ [[ $chezmoi_executable == /* ]]
+ cancel_parent=${TMPDIR:-/tmp}
+ cancel_parent=$(cd -P -- "$cancel_parent" && pwd -P)
+ cancel_root=$(mktemp -d "$cancel_parent/dotfiles-cancel.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$cancel_root" "$cancel_parent" dotfiles-cancel.' EXIT HUP INT TERM
+
+ destination="$cancel_root/destination"
+ backup_parent="$cancel_root/backups"
+ cancel_log="$cancel_root/bootstrap.log"
+ original_fish="$cancel_root/original-fish-config"
+ mkdir -p -- "$destination/.config/fish" "$backup_parent"
+ chmod 0700 "$destination/.config" "$destination/.config/fish"
+ printf 'pre-existing fish config\n' >"$original_fish"
+ cp "$original_fish" "$destination/.config/fish/config.fish"
+
+ # chezmoi returns success when an interactive user chooses quit. Drive a real
+ # pseudo-terminal and prove the subsequent verify failure is transactional.
+ if ! python3 - \
+ "$repo_root/scripts/bootstrap" \
+ --apply \
+ --no-linux-x11 \
+ --destination "$destination" \
+ --backup-parent "$backup_parent" \
+ --chezmoi "$chezmoi_executable" \
+ >"$cancel_log" 2>&1 <<'PY'
+import os
+import pty
+import select
+import signal
+import sys
+import time
+
+argv = sys.argv[1:]
+
+
+def terminate_process_group(pid, term_grace):
+ try:
+ os.killpg(pid, signal.SIGTERM)
+ except ProcessLookupError:
+ pass
+
+ deadline = time.monotonic() + term_grace
+ status = None
+ while time.monotonic() < deadline:
+ if status is None:
+ waited, child_status = os.waitpid(pid, os.WNOHANG)
+ if waited == pid:
+ status = child_status
+ if status is not None:
+ try:
+ os.killpg(pid, 0)
+ except ProcessLookupError:
+ return status
+ time.sleep(0.05)
+
+ try:
+ os.killpg(pid, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ if status is None:
+ _, status = os.waitpid(pid, 0)
+ return status
+
+
+def drive_pty(argv, expected, response, timeout, term_grace, stream_output):
+ pid, fd = pty.fork()
+ if pid == 0:
+ os.execv(argv[0], argv)
+
+ deadline = time.monotonic() + timeout
+ output = bytearray()
+ sent_response = False
+ status = None
+ timed_out = False
+
+ try:
+ while status is None:
+ if time.monotonic() >= deadline:
+ timed_out = True
+ status = terminate_process_group(pid, term_grace)
+ break
+
+ ready, _, _ = select.select([fd], [], [], 0.1)
+ if ready:
+ try:
+ data = os.read(fd, 4096)
+ except OSError:
+ data = b""
+ if data:
+ if stream_output:
+ sys.stdout.buffer.write(data)
+ sys.stdout.buffer.flush()
+ output.extend(data)
+ if not sent_response and expected in output:
+ os.write(fd, response)
+ sent_response = True
+
+ waited, child_status = os.waitpid(pid, os.WNOHANG)
+ if waited == pid:
+ status = child_status
+ finally:
+ os.close(fd)
+
+ return status, sent_response, timed_out, bytes(output)
+
+
+status, sent_quit, timed_out, _ = drive_pty(
+ argv,
+ b"already exists?",
+ b"q\n",
+ timeout=60,
+ term_grace=5,
+ stream_output=True,
+)
+if timed_out:
+ raise SystemExit("timed out waiting for the chezmoi conflict prompt")
+if not sent_quit:
+ raise SystemExit("chezmoi conflict prompt was not observed")
+if os.waitstatus_to_exitcode(status) == 0:
+ raise SystemExit("bootstrap unexpectedly succeeded after interactive quit")
+
+# Exercise the timeout's bounded SIGKILL fallback with a stubborn process
+# group, without making the normal regression path wait for the long deadline.
+probe = (
+ "import os, signal, time; "
+ "signal.signal(signal.SIGTERM, signal.SIG_IGN); "
+ "child = os.fork(); "
+ "child == 0 and signal.signal(signal.SIGTERM, signal.SIG_IGN); "
+ "print('probe-ready', flush=True); "
+ "time.sleep(60)"
+)
+_, _, probe_timed_out, probe_output = drive_pty(
+ [sys.executable, "-c", probe],
+ b"never-send-a-response",
+ b"",
+ timeout=0.2,
+ term_grace=0.2,
+ stream_output=False,
+)
+if not probe_timed_out or b"probe-ready" not in probe_output:
+ raise SystemExit("PTY process-group timeout regression failed")
+PY
+ then
+ printf 'interactive cancel regression failed:\n' >&2
+ command cat "$cancel_log" >&2
+ return 1
+ fi
+
+ cmp "$original_fish" "$destination/.config/fish/config.fish"
+ [[ $(python3 -c 'import os, stat, sys; print(format(stat.S_IMODE(os.stat(sys.argv[1]).st_mode), "o"))' "$destination/.config") == 700 ]]
+ [[ $(python3 -c 'import os, stat, sys; print(format(stat.S_IMODE(os.stat(sys.argv[1]).st_mode), "o"))' "$destination/.config/fish") == 700 ]]
+ [[ ! -e $destination/.config/alacritty/alacritty.toml ]]
+ [[ ! -e $destination/.config/nvim/init.lua ]]
+ [[ $(find "$backup_parent" -mindepth 1 -maxdepth 1 -type d -name 'backup-*' | wc -l | tr -d ' ') == 1 ]]
+ grep -Fq 'Post-apply verification failed or the interactive migration was cancelled' "$cancel_log"
+ grep -Fq 'Automatic rollback completed' "$cancel_log"
+)
+
+check_signal_exit_contracts() (
+ set -euo pipefail
+
+ local chezmoi_executable
+ local signal_parent
+ local signal_root
+ local active_pid=
+ local active_release=
+ local bootstrap_destination
+ local bootstrap_backup_parent
+ local bootstrap_marker
+ local bootstrap_release
+ local bootstrap_log
+ local bootstrap_pid
+ local bootstrap_status
+ local original_fish
+ local backup_destination
+ local backup_parent
+ local backup_paths
+ local backup_marker
+ local backup_release
+ local backup_log
+ local backup_output
+ local backup_pid
+ local backup_status
+ local restore_backup
+ local restore_marker
+ local restore_release
+ local restore_log
+ local restore_pid
+ local restore_status
+ local installer_bin
+ local installer_marker
+ local installer_release
+ local installer_log
+ local installer_pid
+ local installer_status
+ local real_cp
+
+ wait_for_marker() {
+ local marker=$1
+ local pid=$2
+ local count
+
+ for ((count = 0; count < 300; count++)); do
+ [[ -e $marker ]] && return 0
+ kill -0 "$pid" 2>/dev/null || return 1
+ sleep 0.1
+ done
+ return 1
+ }
+
+ # shellcheck disable=SC2317,SC2329
+ cleanup_signal_contracts() {
+ if [[ -n $active_pid ]] && kill -0 "$active_pid" 2>/dev/null; then
+ [[ -z $active_release ]] || : >"$active_release"
+ kill -TERM "$active_pid" 2>/dev/null || true
+ wait "$active_pid" 2>/dev/null || true
+ fi
+ dotfiles_safe_cleanup_tree "$signal_root" "$signal_parent" dotfiles-signals.
+ }
+
+ chezmoi_executable=$(command -v chezmoi)
+ real_cp=$(command -v cp)
+ [[ $chezmoi_executable == /* && $real_cp == /* ]]
+ signal_parent=${TMPDIR:-/tmp}
+ signal_parent=$(cd -P -- "$signal_parent" && pwd -P)
+ signal_root=$(mktemp -d "$signal_parent/dotfiles-signals.XXXXXXXX")
+ trap cleanup_signal_contracts EXIT HUP INT TERM
+
+ mkdir -p -- "$signal_root/mock-chezmoi" "$signal_root/mock-cp"
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/usr/bin/env bash' \
+ 'set -u' \
+ 'is_apply=0' \
+ 'for argument in "$@"; do' \
+ ' [[ $argument != apply ]] || is_apply=1' \
+ 'done' \
+ '"$DOTFILES_TEST_REAL_CHEZMOI" "$@"' \
+ 'status=$?' \
+ 'if ((is_apply == 1 && status == 0)); then' \
+ ' : >"$DOTFILES_TEST_MARKER"' \
+ ' for ((index = 0; index < 300; index++)); do' \
+ ' [[ ! -e $DOTFILES_TEST_RELEASE ]] || exit "$status"' \
+ ' sleep 0.1' \
+ ' done' \
+ ' exit 124' \
+ 'fi' \
+ 'exit "$status"' \
+ >"$signal_root/mock-chezmoi/chezmoi"
+ chmod 0755 "$signal_root/mock-chezmoi/chezmoi"
+
+ # Signal the bootstrap main PID only after the child chezmoi apply has
+ # written managed targets. Bash delivers the pending trap when the child
+ # returns; the handler must rollback and exit 143 instead of verifying and
+ # printing success.
+ bootstrap_destination="$signal_root/bootstrap-destination"
+ bootstrap_backup_parent="$signal_root/bootstrap-backups"
+ bootstrap_marker="$signal_root/bootstrap-applied"
+ bootstrap_release="$signal_root/bootstrap-release"
+ bootstrap_log="$signal_root/bootstrap.log"
+ original_fish="$signal_root/original-fish"
+ mkdir -p -- "$bootstrap_destination/.config/fish" "$bootstrap_backup_parent"
+ printf 'pre-signal fish config\n' >"$original_fish"
+ cp "$original_fish" "$bootstrap_destination/.config/fish/config.fish"
+
+ DOTFILES_TEST_REAL_CHEZMOI="$chezmoi_executable" \
+ DOTFILES_TEST_MARKER="$bootstrap_marker" \
+ DOTFILES_TEST_RELEASE="$bootstrap_release" \
+ "$repo_root/scripts/bootstrap" \
+ --apply \
+ --force \
+ --non-interactive \
+ --no-linux-x11 \
+ --destination "$bootstrap_destination" \
+ --backup-parent "$bootstrap_backup_parent" \
+ --chezmoi "$signal_root/mock-chezmoi/chezmoi" \
+ >"$bootstrap_log" 2>&1 &
+ bootstrap_pid=$!
+ active_pid=$bootstrap_pid
+ active_release=$bootstrap_release
+ wait_for_marker "$bootstrap_marker" "$bootstrap_pid"
+ cmp "$repo_root/home/dot_config/fish/config.fish" \
+ "$bootstrap_destination/.config/fish/config.fish"
+ kill -TERM "$bootstrap_pid"
+ : >"$bootstrap_release"
+ if wait "$bootstrap_pid"; then
+ bootstrap_status=0
+ else
+ bootstrap_status=$?
+ fi
+ active_pid=
+ active_release=
+
+ [[ $bootstrap_status == 143 ]]
+ cmp "$original_fish" "$bootstrap_destination/.config/fish/config.fish"
+ [[ ! -e $bootstrap_destination/.config/nvim/init.lua ]]
+ grep -Fq 'Apply interrupted by a signal' "$bootstrap_log"
+ grep -Fq 'Automatic rollback completed' "$bootstrap_log"
+ if grep -Fq 'Apply and verification completed successfully.' "$bootstrap_log"; then
+ return 1
+ fi
+
+ # Block cp after it has copied a payload but before the parent shell resumes.
+ # This gives backup and restore a deterministic child phase for TERM tests.
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/usr/bin/env bash' \
+ 'set -u' \
+ '"$DOTFILES_TEST_REAL_CP" "$@"' \
+ 'status=$?' \
+ ': >"$DOTFILES_TEST_MARKER"' \
+ 'for ((index = 0; index < 300; index++)); do' \
+ ' [[ ! -e $DOTFILES_TEST_RELEASE ]] || exit "$status"' \
+ ' sleep 0.1' \
+ 'done' \
+ 'exit 124' \
+ >"$signal_root/mock-cp/cp"
+ chmod 0755 "$signal_root/mock-cp/cp"
+
+ backup_destination="$signal_root/backup-destination"
+ backup_parent="$signal_root/backup-parent"
+ backup_paths="$signal_root/backup-paths"
+ backup_marker="$signal_root/backup-copied"
+ backup_release="$signal_root/backup-release"
+ backup_log="$signal_root/backup.log"
+ backup_output="$signal_root/backup.out"
+ mkdir -p -- "$backup_destination" "$backup_parent"
+ printf 'backup payload\n' >"$backup_destination/managed"
+ printf 'managed\n' >"$backup_paths"
+
+ PATH="$signal_root/mock-cp:$PATH" \
+ DOTFILES_TEST_REAL_CP="$real_cp" \
+ DOTFILES_TEST_MARKER="$backup_marker" \
+ DOTFILES_TEST_RELEASE="$backup_release" \
+ "$repo_root/scripts/backup" \
+ --destination "$backup_destination" \
+ --output-parent "$backup_parent" \
+ --paths-file "$backup_paths" \
+ >"$backup_output" 2>"$backup_log" &
+ backup_pid=$!
+ active_pid=$backup_pid
+ active_release=$backup_release
+ wait_for_marker "$backup_marker" "$backup_pid"
+ kill -TERM "$backup_pid"
+ : >"$backup_release"
+ if wait "$backup_pid"; then
+ backup_status=0
+ else
+ backup_status=$?
+ fi
+ active_pid=
+ active_release=
+
+ [[ $backup_status == 143 ]]
+ [[ -z $(find "$backup_parent" -mindepth 1 -maxdepth 1 -name 'backup-*' -print -quit) ]]
+ if grep -Fq 'Backed up ' "$backup_log"; then
+ return 1
+ fi
+
+ restore_backup=$(
+ "$repo_root/scripts/backup" \
+ --destination "$backup_destination" \
+ --output-parent "$backup_parent" \
+ --paths-file "$backup_paths" \
+ 2>"$signal_root/restore-backup.log"
+ )
+ printf 'changed before interrupted restore\n' >"$backup_destination/managed"
+ restore_marker="$signal_root/restore-copied"
+ restore_release="$signal_root/restore-release"
+ restore_log="$signal_root/restore.log"
+
+ PATH="$signal_root/mock-cp:$PATH" \
+ DOTFILES_TEST_REAL_CP="$real_cp" \
+ DOTFILES_TEST_MARKER="$restore_marker" \
+ DOTFILES_TEST_RELEASE="$restore_release" \
+ "$repo_root/scripts/restore" --apply "$restore_backup" \
+ >"$restore_log" 2>&1 &
+ restore_pid=$!
+ active_pid=$restore_pid
+ active_release=$restore_release
+ wait_for_marker "$restore_marker" "$restore_pid"
+ kill -TERM "$restore_pid"
+ : >"$restore_release"
+ if wait "$restore_pid"; then
+ restore_status=0
+ else
+ restore_status=$?
+ fi
+ active_pid=
+ active_release=
+
+ [[ $restore_status == 143 ]]
+ grep -Fqx 'changed before interrupted restore' "$backup_destination/managed"
+ [[ -z $(find "$backup_destination" -name '.dotfiles-restore.*' -print -quit) ]]
+ if grep -Fq 'Restored ' "$restore_log"; then
+ return 1
+ fi
+
+ # The installer checks an existing executable in a child command. TERM of
+ # the installer main PID must prevent the subsequent already-installed
+ # success path even when that child later reports the pinned version.
+ installer_bin="$signal_root/installer-bin"
+ installer_marker="$signal_root/installer-version-checked"
+ installer_release="$signal_root/installer-release"
+ installer_log="$signal_root/installer.log"
+ mkdir -p -- "$installer_bin"
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/usr/bin/env bash' \
+ 'set -u' \
+ '[[ ${1:-} == --version ]] || exit 64' \
+ ': >"$DOTFILES_TEST_MARKER"' \
+ 'for ((index = 0; index < 300; index++)); do' \
+ ' if [[ -e $DOTFILES_TEST_RELEASE ]]; then' \
+ ' printf "%s\\n" "chezmoi version v2.72.0"' \
+ ' exit 0' \
+ ' fi' \
+ ' sleep 0.1' \
+ 'done' \
+ 'exit 124' \
+ >"$installer_bin/chezmoi"
+ chmod 0755 "$installer_bin/chezmoi"
+
+ DOTFILES_TEST_MARKER="$installer_marker" \
+ DOTFILES_TEST_RELEASE="$installer_release" \
+ "$repo_root/scripts/install-chezmoi" --bin-dir "$installer_bin" \
+ >"$installer_log" 2>&1 &
+ installer_pid=$!
+ active_pid=$installer_pid
+ active_release=$installer_release
+ wait_for_marker "$installer_marker" "$installer_pid"
+ kill -TERM "$installer_pid"
+ : >"$installer_release"
+ if wait "$installer_pid"; then
+ installer_status=0
+ else
+ installer_status=$?
+ fi
+ active_pid=
+ active_release=
+
+ [[ $installer_status == 143 ]]
+ if grep -Fq 'already installed' "$installer_log" ||
+ grep -Fq 'Installed chezmoi' "$installer_log"; then
+ return 1
+ fi
+)
+
+check_chezmoi_clean_legacy_rollback() (
+ set -euo pipefail
+
+ local chezmoi_executable
+ local cleanup_parent
+ local cleanup_root
+ local destination
+ local backup_parent
+ local mock_bin
+ local cleanup_log
+ local original_fisher
+ local original_z
+ local real_rm
+
+ chezmoi_executable=$(command -v chezmoi)
+ real_rm=$(command -v rm)
+ [[ $chezmoi_executable == /* && $real_rm == /* ]]
+ cleanup_parent=${TMPDIR:-/tmp}
+ cleanup_parent=$(cd -P -- "$cleanup_parent" && pwd -P)
+ cleanup_root=$(mktemp -d "$cleanup_parent/dotfiles-clean-rollback.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$cleanup_root" "$cleanup_parent" dotfiles-clean-rollback.' EXIT HUP INT TERM
+
+ destination="$cleanup_root/destination"
+ backup_parent="$cleanup_root/backups"
+ mock_bin="$cleanup_root/mock-bin"
+ cleanup_log="$cleanup_root/bootstrap.log"
+ original_fisher="$cleanup_root/original-fisher"
+ original_z="$cleanup_root/original-z"
+ mkdir -p -- \
+ "$destination/.config/fish/completions" \
+ "$destination/.config/fish/conf.d" \
+ "$backup_parent" \
+ "$mock_bin"
+ printf 'legacy fisher completion\n' >"$original_fisher"
+ printf 'legacy z plugin\n' >"$original_z"
+ cp "$original_fisher" "$destination/.config/fish/completions/fisher.fish"
+ cp "$original_z" "$destination/.config/fish/conf.d/z.fish"
+
+ # shellcheck disable=SC2016
+ printf '%s\n' \
+ '#!/usr/bin/env bash' \
+ 'set -u' \
+ 'for argument in "$@"; do' \
+ ' case $argument in' \
+ ' */.config/fish/conf.d/z.fish) exit 73 ;;' \
+ ' esac' \
+ 'done' \
+ 'exec "$DOTFILES_TEST_REAL_RM" "$@"' \
+ >"$mock_bin/rm"
+ chmod 0755 "$mock_bin/rm"
+
+ if PATH="$mock_bin:$PATH" DOTFILES_TEST_REAL_RM="$real_rm" \
+ "$repo_root/scripts/bootstrap" \
+ --apply \
+ --force \
+ --clean-legacy \
+ --non-interactive \
+ --no-linux-x11 \
+ --destination "$destination" \
+ --backup-parent "$backup_parent" \
+ --chezmoi "$chezmoi_executable" \
+ >"$cleanup_log" 2>&1; then
+ printf 'bootstrap unexpectedly succeeded after a mid-cleanup deletion failure\n' >&2
+ return 1
+ fi
+
+ cmp "$original_fisher" "$destination/.config/fish/completions/fisher.fish"
+ cmp "$original_z" "$destination/.config/fish/conf.d/z.fish"
+ [[ ! -e $destination/.config/nvim/init.lua ]]
+ grep -Fq 'Retired Fish cleanup failed' "$cleanup_log"
+ grep -Fq 'Automatic rollback completed' "$cleanup_log"
+ if grep -Fq 'Apply and verification completed successfully.' "$cleanup_log"; then
+ return 1
+ fi
+)
+
+check_chezmoi_destination_symlink_safety() (
+ set -euo pipefail
+
+ local chezmoi_executable
+ local safety_parent
+ local safety_root
+ local destination
+ local outside
+ local backup_destination
+ local backup_outside
+ local bootstrap_log
+ local backup_log
+
+ chezmoi_executable=$(command -v chezmoi)
+ [[ $chezmoi_executable == /* ]]
+ safety_parent=${TMPDIR:-/tmp}
+ safety_parent=$(cd -P -- "$safety_parent" && pwd -P)
+ safety_root=$(mktemp -d "$safety_parent/dotfiles-bootstrap-safety.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$safety_root" "$safety_parent" dotfiles-bootstrap-safety.' EXIT HUP INT TERM
+
+ destination="$safety_root/destination"
+ outside="$safety_root/outside"
+ bootstrap_log="$safety_root/bootstrap.log"
+ mkdir -p -- "$destination" "$outside"
+ ln -s "$outside" "$destination/.config"
+
+ if "$repo_root/scripts/bootstrap" \
+ --non-interactive \
+ --no-linux-x11 \
+ --destination "$destination" \
+ --chezmoi "$chezmoi_executable" \
+ >"$bootstrap_log" 2>&1; then
+ printf 'bootstrap preview unexpectedly followed a destination parent symlink\n' >&2
+ return 1
+ fi
+
+ [[ -L $destination/.config ]]
+ [[ $(readlink "$destination/.config") == "$outside" ]]
+ [[ -z $(find "$outside" -mindepth 1 -maxdepth 1 -print -quit) ]]
+ [[ ! -e $destination/.cache && ! -L $destination/.cache ]]
+ [[ ! -e $destination/.local && ! -L $destination/.local ]]
+ grep -Fq "refusing symlinked parent: $destination/.config" "$bootstrap_log"
+
+ # With an explicit destination, the implicit backup parent is
+ # destination-local. Its complete parent chain must be validated before
+ # bootstrap creates config/cache/state paths or initializes chezmoi.
+ backup_destination="$safety_root/backup-destination"
+ backup_outside="$safety_root/backup-outside"
+ backup_log="$safety_root/backup-boundary.log"
+ mkdir -p -- "$backup_destination/.local/state" "$backup_outside"
+ ln -s "$backup_outside" "$backup_destination/.local/state/dotfiles"
+
+ if "$repo_root/scripts/bootstrap" \
+ --non-interactive \
+ --no-linux-x11 \
+ --destination "$backup_destination" \
+ --chezmoi "$chezmoi_executable" \
+ >"$backup_log" 2>&1; then
+ printf 'bootstrap preview unexpectedly followed the default backup parent symlink\n' >&2
+ return 1
+ fi
+
+ [[ -L $backup_destination/.local/state/dotfiles ]]
+ [[ $(readlink "$backup_destination/.local/state/dotfiles") == "$backup_outside" ]]
+ [[ -z $(find "$backup_outside" -mindepth 1 -maxdepth 1 -print -quit) ]]
+ [[ ! -e $backup_destination/.config && ! -L $backup_destination/.config ]]
+ [[ ! -e $backup_destination/.cache && ! -L $backup_destination/.cache ]]
+ [[ ! -e $backup_destination/.local/state/chezmoi && ! -L $backup_destination/.local/state/chezmoi ]]
+ grep -Fq "refusing symlinked parent: $backup_destination/.local/state/dotfiles" "$backup_log"
+)
+
+check_restore_symlink_directory_safety() (
+ set -euo pipefail
+
+ local restore_parent
+ local restore_root
+ local destination
+ local paths_file
+ local backup_dir
+ local outside
+
+ restore_parent=${TMPDIR:-/tmp}
+ restore_parent=$(cd -P -- "$restore_parent" && pwd -P)
+ restore_root=$(mktemp -d "$restore_parent/dotfiles-restore-safety.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$restore_root" "$restore_parent" dotfiles-restore-safety.' EXIT HUP INT TERM
+ destination="$restore_root/destination"
+ outside="$restore_root/outside"
+ paths_file="$restore_root/paths"
+ mkdir -p -- "$destination" "$restore_root/backups" "$outside"
+ printf 'original\n' >"$destination/managed-file"
+ ln -s "$outside" "$destination/managed-link"
+ printf 'managed-file\nmanaged-link\n' >"$paths_file"
+
+ backup_dir=$("$repo_root/scripts/backup" \
+ --paths-file "$paths_file" \
+ --destination "$destination" \
+ --output-parent "$restore_root/backups" \
+ 2>"$restore_root/backup.log")
+
+ rm -f -- "$destination/managed-file" "$destination/managed-link"
+ ln -s "$outside" "$destination/managed-file"
+ printf 'changed\n' >"$destination/managed-link"
+
+ "$repo_root/scripts/restore" --apply "$backup_dir" >"$restore_root/restore.log" 2>&1
+ [[ -f $destination/managed-file && ! -L $destination/managed-file ]]
+ [[ $(cat "$destination/managed-file") == original ]]
+ [[ -L $destination/managed-link ]]
+ [[ $(readlink "$destination/managed-link") == "$outside" ]]
+ [[ -z $(find "$outside" -mindepth 1 -maxdepth 1 -print -quit) ]]
+)
+
+check_installer_path_shadow() (
+ set -euo pipefail
+
+ local chezmoi_executable
+ local installer_parent
+ local installer_root
+ local target_dir
+ local shadow_dir
+ local installer_log
+
+ chezmoi_executable=$(command -v chezmoi)
+ [[ $chezmoi_executable == /* ]]
+
+ installer_parent=${TMPDIR:-/tmp}
+ installer_parent=$(cd -P -- "$installer_parent" && pwd -P)
+ installer_root=$(mktemp -d "$installer_parent/dotfiles-installer.XXXXXXXX")
+ trap 'dotfiles_safe_cleanup_tree "$installer_root" "$installer_parent" dotfiles-installer.' EXIT HUP INT TERM
+ target_dir="$installer_root/target with space"
+ shadow_dir="$installer_root/shadow"
+ installer_log="$installer_root/install.log"
+ mkdir -p -- "$target_dir" "$shadow_dir"
+
+ cp "$chezmoi_executable" "$target_dir/chezmoi"
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'printf "%s\\n" "chezmoi version v2.70.0"' \
+ >"$shadow_dir/chezmoi"
+ chmod 0755 "$shadow_dir/chezmoi"
+
+ PATH="$shadow_dir:$PATH" \
+ "$repo_root/scripts/install-chezmoi" --bin-dir "$target_dir" \
+ >"$installer_log" 2>&1
+
+ grep -Fq "PATH currently resolves chezmoi to $shadow_dir/chezmoi" "$installer_log"
+ grep -Fq -- '--chezmoi' "$installer_log"
+
+ mkdir -p -- "$installer_root/symlink-bin" "$installer_root/outside"
+ ln -s "$installer_root/outside" "$installer_root/symlink-bin/chezmoi"
+ if "$repo_root/scripts/install-chezmoi" \
+ --force \
+ --bin-dir "$installer_root/symlink-bin" \
+ >"$installer_log" 2>&1; then
+ printf 'installer unexpectedly followed a target symlink to a directory\n' >&2
+ return 1
+ fi
+ [[ -L $installer_root/symlink-bin/chezmoi ]]
+ [[ -z $(find "$installer_root/outside" -mindepth 1 -maxdepth 1 -print -quit) ]]
+)
+
+run 'Repository whitespace and final newlines' check_repository_whitespace
+
+if have rg; then
+ run 'No personal absolute paths' check_no_personal_paths
+elif [[ $strict == 1 ]]; then
+ fail 'No personal absolute paths (missing: rg)'
+else
+ skip 'No personal absolute paths (missing: rg)'
+fi
+
+optional bash 'Shell syntax' check_shell
+optional shellcheck 'ShellCheck (owned shell files)' check_shellcheck
+optional bash 'Restore symlink-to-directory entry safety and round trip' check_restore_symlink_directory_safety
+optional fish 'Fish syntax (14 source files)' check_fish
+optional fish_indent 'Fish formatting (7 owned files)' check_fish_format
+optional fish 'Fish XDG empty/relative fallback' check_fish_xdg_defaults
+optional fish 'Fish Go bin path precedence' check_fish_go_path
+if have fish && have git; then
+ run 'Fish prompt branch and dirty-state behavior' check_fish_prompt_behavior
+elif [[ $strict == 1 ]]; then
+ fail 'Fish prompt branch and dirty-state behavior (missing: fish or git)'
+else
+ skip 'Fish prompt branch and dirty-state behavior (missing: fish or git)'
+fi
+if have bash && have fish && have git && have python3; then
+ run 'Local performance benchmark smoke' check_performance_benchmark
+elif [[ $strict == 1 ]]; then
+ fail 'Local performance benchmark smoke (missing: bash, fish, git, or python3)'
+else
+ skip 'Local performance benchmark smoke (missing: bash, fish, git, or python3)'
+fi
+optional python3 'Legacy Fish cleanup manifest' check_legacy_fish_manifest
+optional luac 'Lua syntax' check_lua
+optional lua 'Neovim HSL color conversion' check_hsl_colors
+optional nvim 'Neovim 0.12 API smoke' check_nvim_api
+optional bash 'Neovim setup lock ownership and TERM cleanup' check_nvim_setup_lock_and_signal
+if have nvim && have git && have python3; then
+ run 'Neovim plugin preflight integrity and metadata isolation' check_nvim_preflight_integrity
+elif [[ $strict == 1 ]]; then
+ fail 'Neovim plugin preflight integrity and metadata isolation (missing: nvim, git, or python3)'
+else
+ skip 'Neovim plugin preflight integrity and metadata isolation (missing: nvim, git, or python3)'
+fi
+optional jq 'JSON syntax' check_json
+optional python3 'Neovim lock graph (50 pinned plugins)' check_nvim_lock
+if [[ ${DOTFILES_CHECK_NETWORK:-0} == 1 ]]; then
+ if have nvim && have git && have jq; then
+ run 'Neovim pinned bootstrap and first lock write' check_nvim_bootstrap
+ elif [[ $strict == 1 ]]; then
+ fail 'Neovim pinned bootstrap and first lock write (missing: nvim, git, or jq)'
+ else
+ skip 'Neovim pinned bootstrap and first lock write (missing: nvim, git, or jq)'
+ fi
+else
+ skip 'Neovim pinned bootstrap and first lock write (network canary disabled)'
+fi
+if [[ ${DOTFILES_CHECK_NVIM_FULL:-0} == 1 ]]; then
+ if have nvim && have git && have jq && have python3 && have cc; then
+ run 'Neovim full cold start (50 locked plugins and toolchain)' check_nvim_first_start
+ elif [[ $strict == 1 ]]; then
+ fail 'Neovim full cold start (missing: nvim, git, jq, python3, or C compiler)'
+ else
+ skip 'Neovim full cold start (missing: nvim, git, jq, python3, or C compiler)'
+ fi
+else
+ skip 'Neovim full cold start (full network canary disabled)'
+fi
+optional python3 'TOML syntax and upstream metadata' check_toml
+optional python3 'Solarized Osaka palette consistency and contrast' check_theme
+optional python3 'nvm.fish vendor SHA-256' check_nvm_vendor
+optional python3 'ranger scope vendor SHA-256' check_ranger_vendor
+optional python3 'HSL color helper vendor SHA-256' check_hsl_vendor
+optional tmux 'tmux syntax' check_tmux
+optional file 'ranger text-preview portability' check_ranger_scope
+optional bash 'ranger private font-preview temporary path' check_ranger_font_temp
+optional bash 'ranger image, video, and PDF preview behavior' check_ranger_media_previews
+run 'ranger minimal configuration' check_ranger_config
+if have ranger; then
+ run 'ranger configuration parse' check_ranger_config_parse
+else
+ skip 'ranger configuration parse (missing: ranger)'
+fi
+optional chezmoi 'chezmoi bootstrap destination symlink boundary' check_chezmoi_destination_symlink_safety
+optional chezmoi 'signal exit contracts and interrupted apply rollback' check_signal_exit_contracts
+optional chezmoi 'chezmoi core apply/verify/idempotence' check_chezmoi_profile false
+optional chezmoi 'chezmoi migration backup/force/restore' check_chezmoi_migration_restore
+optional chezmoi 'chezmoi mid-cleanup rollback' check_chezmoi_clean_legacy_rollback
+if have chezmoi && have python3; then
+ run 'chezmoi interactive cancel rollback' check_chezmoi_interactive_cancel
+elif [[ $strict == 1 ]]; then
+ fail 'chezmoi interactive cancel rollback (missing: chezmoi or python3)'
+else
+ skip 'chezmoi interactive cancel rollback (missing: chezmoi or python3)'
+fi
+optional chezmoi 'chezmoi installer PATH-shadow guidance' check_installer_path_shadow
+
+if [[ $(uname -s) == Linux ]]; then
+ optional i3 'i3 configuration' check_i3
+ optional chezmoi 'chezmoi Linux X11 profile and executable targets' check_chezmoi_profile true
+else
+ skip 'i3 configuration (Linux-only)'
+ skip 'chezmoi Linux X11 profile and executable targets (Linux-only)'
+fi
+
+printf '\n%d failure(s), %d skipped check(s)\n' "$failures" "$skips"
+((failures == 0))
diff --git a/scripts/install-chezmoi b/scripts/install-chezmoi
new file mode 100755
index 0000000..9d25d2a
--- /dev/null
+++ b/scripts/install-chezmoi
@@ -0,0 +1,211 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
+# shellcheck disable=SC1091
+source "$script_dir/lib/safety.bash"
+
+readonly install_version=2.72.0
+install_force=0
+install_bin_dir=${HOME:+$HOME/.local/bin}
+install_tmp_root=
+install_tmp_parent=
+install_stage=
+
+usage() {
+ cat <<'EOF'
+Usage: scripts/install-chezmoi [--force] [--bin-dir DIR]
+
+Install the repository-pinned chezmoi release after verifying a static SHA-256.
+An existing different version is never replaced unless --force is supplied.
+No privilege escalation or shell-from-network execution is used.
+EOF
+}
+
+cleanup() {
+ if [[ -n $install_stage && -n $install_bin_dir ]]; then
+ case "$install_stage" in
+ "$install_bin_dir"/.chezmoi-install.*)
+ [[ ! -d $install_stage ]] && rm -f -- "$install_stage"
+ ;;
+ esac
+ install_stage=
+ fi
+ if [[ -n $install_tmp_root && -n $install_tmp_parent ]]; then
+ dotfiles_safe_cleanup_tree "$install_tmp_root" "$install_tmp_parent" dotfiles-chezmoi.
+ install_tmp_root=
+ fi
+}
+
+exit_for_signal() {
+ local status=$1
+
+ trap - HUP INT TERM
+ cleanup || true
+ trap - EXIT
+ exit "$status"
+}
+
+trap cleanup EXIT
+trap 'exit_for_signal 129' HUP
+trap 'exit_for_signal 130' INT
+trap 'exit_for_signal 143' TERM
+
+chezmoi_is_pinned_version() {
+ local executable=$1
+ local output
+
+ [[ -x $executable && ! -d $executable ]] || return 1
+ output=$("$executable" --version 2>/dev/null) || return 1
+ [[ $output =~ ^chezmoi[[:space:]]version[[:space:]]v?2\.72\.0([,[:space:]]|$) ]]
+}
+
+report_target_resolution() {
+ local resolved
+
+ resolved=$(command -v chezmoi 2>/dev/null || true)
+ if [[ $resolved == "$install_target" ]]; then
+ return 0
+ fi
+
+ if [[ -n $resolved ]]; then
+ printf 'Note: PATH currently resolves chezmoi to %s, before %s.\n' \
+ "$resolved" "$install_target" >&2
+ printf 'Reorder PATH, or bypass the shadowed command with:\n' >&2
+ else
+ printf 'Note: %s is not currently resolved through PATH. Use:\n' \
+ "$install_target" >&2
+ fi
+ printf ' %q --chezmoi %q\n' "$script_dir/bootstrap" "$install_target" >&2
+}
+
+download_asset() {
+ local url=$1
+ local output=$2
+
+ if command -v curl >/dev/null 2>&1; then
+ curl --fail --location --silent --show-error \
+ --proto '=https' --tlsv1.2 \
+ --connect-timeout 15 --max-time 300 \
+ --retry 3 --retry-delay 2 --retry-connrefused \
+ --output "$output" "$url"
+ elif command -v wget >/dev/null 2>&1; then
+ wget --https-only --secure-protocol=TLSv1_2 \
+ --timeout=30 --tries=4 --waitretry=2 \
+ --output-document="$output" "$url"
+ else
+ dotfiles_die 'curl or wget is required to download chezmoi'
+ fi
+}
+
+verify_sha256() {
+ local file=$1
+ local expected=$2
+ local actual
+
+ if command -v sha256sum >/dev/null 2>&1; then
+ actual=$(sha256sum "$file" | awk '{print $1}')
+ elif command -v shasum >/dev/null 2>&1; then
+ actual=$(shasum -a 256 "$file" | awk '{print $1}')
+ else
+ dotfiles_die 'sha256sum or shasum is required to verify chezmoi'
+ fi
+ [[ $actual == "$expected" ]] ||
+ dotfiles_die "SHA-256 mismatch: expected $expected, got $actual"
+}
+
+while (($# > 0)); do
+ case $1 in
+ --force)
+ install_force=1
+ shift
+ ;;
+ --bin-dir)
+ (($# >= 2)) || dotfiles_die '--bin-dir requires an argument'
+ install_bin_dir=$2
+ shift 2
+ ;;
+ --bin-dir=*)
+ install_bin_dir=${1#*=}
+ shift
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ *)
+ dotfiles_die "unknown argument: $1"
+ ;;
+ esac
+done
+
+[[ -n $install_bin_dir ]] || dotfiles_die 'HOME is unset; pass --bin-dir explicitly'
+dotfiles_validate_absolute_path "$install_bin_dir" 'installation directory'
+install_bin_dir=$(dotfiles_prepare_directory "$install_bin_dir" 'installation directory')
+install_target="$install_bin_dir/chezmoi"
+
+if [[ -d $install_target ]]; then
+ dotfiles_die "installation target resolves to a directory: $install_target"
+fi
+
+if [[ -e $install_target || -L $install_target ]]; then
+ if chezmoi_is_pinned_version "$install_target"; then
+ printf 'chezmoi %s is already installed at %s\n' "$install_version" "$install_target"
+ report_target_resolution
+ exit 0
+ fi
+ ((install_force == 1)) ||
+ dotfiles_die "a different or invalid chezmoi exists at $install_target; rerun with --force to replace it"
+fi
+
+case $(uname -s) in
+ Darwin) install_os=darwin ;;
+ Linux) install_os=linux ;;
+ *) dotfiles_die "unsupported operating system: $(uname -s)" ;;
+esac
+
+case $(uname -m) in
+ x86_64 | amd64) install_arch=amd64 ;;
+ arm64 | aarch64) install_arch=arm64 ;;
+ *) dotfiles_die "unsupported architecture: $(uname -m)" ;;
+esac
+
+case "$install_os/$install_arch" in
+ darwin/amd64) install_sha256=41be255eacf46b1b333591b4ddc7e90e2aa98ccb8dce47609b8284b856841652 ;;
+ darwin/arm64) install_sha256=53e576042afba703290bbc320e64d0b6bdf1082a8fb9f0d13b97e68a6e6c059f ;;
+ linux/amd64) install_sha256=0d6665b96c527d57fdc562bf19e808f80f48c2d977062c03e3e65c6b09eafbce ;;
+ linux/arm64) install_sha256=e79a27621256390f03166d3965e6a1946f983a096c4d90f02c43d2aa5b563728 ;;
+ *) dotfiles_die "unsupported platform: $install_os/$install_arch" ;;
+esac
+
+install_asset="chezmoi_${install_version}_${install_os}_${install_arch}.tar.gz"
+install_url="https://github.com/twpayne/chezmoi/releases/download/v${install_version}/${install_asset}"
+install_tmp_parent=$(dotfiles_existing_directory "${TMPDIR:-/tmp}" 'temporary directory')
+install_tmp_root=$(mktemp -d "$install_tmp_parent/dotfiles-chezmoi.XXXXXXXX")
+install_archive="$install_tmp_root/$install_asset"
+
+printf 'Downloading %s\n' "$install_url"
+download_asset "$install_url" "$install_archive"
+verify_sha256 "$install_archive" "$install_sha256"
+tar -xzf "$install_archive" -C "$install_tmp_root" chezmoi
+[[ -f $install_tmp_root/chezmoi ]] || dotfiles_die 'release archive did not contain the chezmoi binary'
+chmod 0755 "$install_tmp_root/chezmoi"
+chezmoi_is_pinned_version "$install_tmp_root/chezmoi" ||
+ dotfiles_die 'downloaded binary did not report the pinned version'
+
+install_stage=$(mktemp "$install_bin_dir/.chezmoi-install.XXXXXXXX")
+install -m 0755 "$install_tmp_root/chezmoi" "$install_stage"
+chezmoi_is_pinned_version "$install_stage" || dotfiles_die 'staged binary failed its version check'
+
+if [[ (-e $install_target || -L $install_target) && $install_force -ne 1 ]]; then
+ dotfiles_die "installation target appeared during installation: $install_target"
+fi
+if [[ -d $install_target ]]; then
+ dotfiles_die "installation target became or resolves to a directory: $install_target"
+fi
+dotfiles_atomic_replace "$install_stage" "$install_target"
+install_stage=
+
+printf 'Installed chezmoi %s at %s\n' "$install_version" "$install_target"
+report_target_resolution
diff --git a/scripts/legacy-fish-paths b/scripts/legacy-fish-paths
new file mode 100644
index 0000000..c391a3b
--- /dev/null
+++ b/scripts/legacy-fish-paths
@@ -0,0 +1,96 @@
+.config/fish/completions/fisher.fish
+.config/fish/completions/ghq.fish
+.config/fish/conf.d/fish-exa.fish
+.config/fish/conf.d/ghq_key_bindings.fish
+.config/fish/conf.d/z.fish
+.config/fish/fish_plugins
+.config/fish/functions/__ghq_repository_search.fish
+.config/fish/functions/__z.fish
+.config/fish/functions/__z_add.fish
+.config/fish/functions/__z_clean.fish
+.config/fish/functions/__z_complete.fish
+.config/fish/functions/exa_git.fish
+.config/fish/functions/fisher.fish
+.config/fish/functions/l.fish
+.config/fish/functions/la.fish
+.config/fish/functions/laa.fish
+.config/fish/functions/laad.fish
+.config/fish/functions/laai.fish
+.config/fish/functions/laaid.fish
+.config/fish/functions/lad.fish
+.config/fish/functions/lai.fish
+.config/fish/functions/laid.fish
+.config/fish/functions/lc.fish
+.config/fish/functions/lca.fish
+.config/fish/functions/lcaa.fish
+.config/fish/functions/lcaad.fish
+.config/fish/functions/lcaai.fish
+.config/fish/functions/lcaaid.fish
+.config/fish/functions/lcad.fish
+.config/fish/functions/lcai.fish
+.config/fish/functions/lcaid.fish
+.config/fish/functions/lcd.fish
+.config/fish/functions/lci.fish
+.config/fish/functions/lcid.fish
+.config/fish/functions/ld.fish
+.config/fish/functions/le.fish
+.config/fish/functions/lea.fish
+.config/fish/functions/leaa.fish
+.config/fish/functions/leaad.fish
+.config/fish/functions/leaai.fish
+.config/fish/functions/leaaid.fish
+.config/fish/functions/lead.fish
+.config/fish/functions/leai.fish
+.config/fish/functions/leaid.fish
+.config/fish/functions/led.fish
+.config/fish/functions/lei.fish
+.config/fish/functions/leid.fish
+.config/fish/functions/lg.fish
+.config/fish/functions/lga.fish
+.config/fish/functions/lgaa.fish
+.config/fish/functions/lgaad.fish
+.config/fish/functions/lgaai.fish
+.config/fish/functions/lgaaid.fish
+.config/fish/functions/lgad.fish
+.config/fish/functions/lgai.fish
+.config/fish/functions/lgaid.fish
+.config/fish/functions/lgd.fish
+.config/fish/functions/lgi.fish
+.config/fish/functions/lgid.fish
+.config/fish/functions/li.fish
+.config/fish/functions/lid.fish
+.config/fish/functions/ll.fish
+.config/fish/functions/lla.fish
+.config/fish/functions/llaa.fish
+.config/fish/functions/llaad.fish
+.config/fish/functions/llaai.fish
+.config/fish/functions/llaaid.fish
+.config/fish/functions/llad.fish
+.config/fish/functions/llai.fish
+.config/fish/functions/llaid.fish
+.config/fish/functions/lld.fish
+.config/fish/functions/lli.fish
+.config/fish/functions/llid.fish
+.config/fish/functions/lo.fish
+.config/fish/functions/loa.fish
+.config/fish/functions/loaa.fish
+.config/fish/functions/loaad.fish
+.config/fish/functions/loaai.fish
+.config/fish/functions/loaaid.fish
+.config/fish/functions/load.fish
+.config/fish/functions/loai.fish
+.config/fish/functions/loaid.fish
+.config/fish/functions/lod.fish
+.config/fish/functions/loi.fish
+.config/fish/functions/loid.fish
+.config/fish/functions/lt.fish
+.config/fish/functions/lta.fish
+.config/fish/functions/ltaad.fish
+.config/fish/functions/ltaai.fish
+.config/fish/functions/ltaaid.fish
+.config/fish/functions/ltad.fish
+.config/fish/functions/ltai.fish
+.config/fish/functions/ltaid.fish
+.config/fish/functions/ltd.fish
+.config/fish/functions/lti.fish
+.config/fish/functions/ltid.fish
diff --git a/scripts/lib/safety.bash b/scripts/lib/safety.bash
new file mode 100644
index 0000000..5e08d9e
--- /dev/null
+++ b/scripts/lib/safety.bash
@@ -0,0 +1,120 @@
+#!/usr/bin/env bash
+
+# Shared path validation for the bootstrap backup and restore tools. This file
+# is sourced by other scripts and intentionally has no executable entry point.
+
+dotfiles_die() {
+ printf 'error: %s\n' "$*" >&2
+ exit 1
+}
+
+dotfiles_validate_absolute_path() {
+ local candidate=$1
+ local description=${2:-path}
+
+ [[ -n $candidate ]] || dotfiles_die "$description is empty"
+ [[ $candidate == /* ]] || dotfiles_die "$description must be absolute: $candidate"
+ [[ $candidate != / ]] || dotfiles_die "$description must not be /"
+ [[ $candidate != *$'\n'* && $candidate != *$'\r'* && $candidate != *$'\t'* ]] ||
+ dotfiles_die "$description contains a control character"
+}
+
+dotfiles_prepare_directory() {
+ local candidate=$1
+ local description=${2:-directory}
+ local canonical
+
+ dotfiles_validate_absolute_path "$candidate" "$description"
+ mkdir -p -- "$candidate"
+ [[ -d $candidate ]] || dotfiles_die "$description is not a directory: $candidate"
+ canonical=$(cd -P -- "$candidate" && pwd -P)
+ dotfiles_validate_absolute_path "$canonical" "$description"
+ printf '%s\n' "$canonical"
+}
+
+dotfiles_existing_directory() {
+ local candidate=$1
+ local description=${2:-directory}
+ local canonical
+
+ dotfiles_validate_absolute_path "$candidate" "$description"
+ [[ -d $candidate ]] || dotfiles_die "$description does not exist: $candidate"
+ canonical=$(cd -P -- "$candidate" && pwd -P)
+ dotfiles_validate_absolute_path "$canonical" "$description"
+ printf '%s\n' "$canonical"
+}
+
+dotfiles_validate_relative_path() {
+ local relative=$1
+ local component
+ local -a components
+
+ [[ -n $relative ]] || dotfiles_die 'managed path is empty'
+ [[ $relative != /* ]] || dotfiles_die "managed path is absolute: $relative"
+ [[ $relative != *$'\n'* && $relative != *$'\r'* && $relative != *$'\t'* ]] ||
+ dotfiles_die 'managed path contains a control character'
+
+ IFS='/' read -r -a components <<<"$relative"
+ ((${#components[@]} > 0)) || dotfiles_die "invalid managed path: $relative"
+ for component in "${components[@]}"; do
+ [[ -n $component && $component != . && $component != .. ]] ||
+ dotfiles_die "unsafe managed path: $relative"
+ done
+}
+
+dotfiles_assert_safe_parent_chain() {
+ local root=$1
+ local relative=$2
+ local current=$root
+ local component
+ local index
+ local -a components
+
+ dotfiles_validate_relative_path "$relative"
+ IFS='/' read -r -a components <<<"$relative"
+ for ((index = 0; index < ${#components[@]} - 1; index++)); do
+ component=${components[$index]}
+ current="$current/$component"
+ [[ ! -L $current ]] || dotfiles_die "refusing symlinked parent: $current"
+ if [[ -e $current && ! -d $current ]]; then
+ dotfiles_die "managed path has a non-directory parent: $current"
+ fi
+ done
+}
+
+dotfiles_safe_cleanup_tree() {
+ local candidate=$1
+ local expected_parent=$2
+ local expected_prefix=$3
+
+ [[ -n $candidate && -n $expected_parent && -n $expected_prefix ]] || return 0
+ case "$candidate" in
+ "$expected_parent"/"$expected_prefix"*)
+ [[ $candidate != "$expected_parent" ]] || return 0
+ rm -rf -- "$candidate"
+ ;;
+ esac
+}
+
+dotfiles_atomic_replace() {
+ local source=$1
+ local target=$2
+
+ [[ -e $source || -L $source ]] || dotfiles_die "replacement source is missing: $source"
+ [[ ! -d $target || -L $target ]] ||
+ dotfiles_die "refusing to replace a real directory target: $target"
+
+ case $(uname -s) in
+ Darwin)
+ # BSD mv -h replaces a destination symlink instead of following it.
+ mv -fh -- "$source" "$target"
+ ;;
+ Linux)
+ # GNU mv -T always treats the destination as a path, never a directory.
+ mv -fT -- "$source" "$target"
+ ;;
+ *)
+ dotfiles_die 'atomic replacement is supported only on macOS and Linux'
+ ;;
+ esac
+}
diff --git a/scripts/nvim-first-start.lua b/scripts/nvim-first-start.lua
new file mode 100644
index 0000000..94cc505
--- /dev/null
+++ b/scripts/nvim-first-start.lua
@@ -0,0 +1,197 @@
+local function assert_unique(label, items)
+ local seen = {}
+ for _, item in ipairs(items) do
+ assert(not seen[item], ("%s contains duplicate %q"):format(label, item))
+ seen[item] = true
+ end
+end
+
+local function canonical_purl(id)
+ local purl = require("mason-core.purl")
+ return purl.parse(id):map(purl.compile):get_or_throw(("invalid Mason package URL: %s"):format(id))
+end
+
+local function wait_for_mason_packages(label, packages, timeout)
+ assert_unique(label, packages)
+ local registry = require("mason-registry")
+ local location = require("mason-core.installer.InstallLocation").global()
+ local mason_root = location:get_dir()
+ local tracked = {}
+ for _, name in ipairs(packages) do
+ local package = registry.get_package(name)
+ tracked[name] = {
+ package = package,
+ lockfile = location:lockfile(name),
+ desired_source_id = canonical_purl(package.spec.source.id),
+ desired_source_type = package.spec.schema,
+ desired_registry = package.registry:serialize(),
+ attempted = false,
+ }
+ end
+
+ local failure
+ local complete = vim.wait(timeout, function()
+ local all_complete = true
+ for name, item in pairs(tracked) do
+ local package = item.package
+ if package:is_installing() then
+ all_complete = false
+ elseif vim.uv.fs_stat(item.lockfile) then
+ -- is_installing() is process-local; the lock also detects another
+ -- Neovim updating the same Mason root. Never bypass that lock.
+ item.external_lock = true
+ all_complete = false
+ else
+ item.external_lock = false
+ local receipt_ok, receipt_optional = pcall(package.get_receipt, package)
+ local has_receipt = receipt_ok and receipt_optional:is_present()
+ local source_matches = false
+ local registry_matches = false
+ local installed_source_id = receipt_ok and "no receipt" or "unreadable receipt"
+ if not receipt_ok or (not has_receipt and package:is_installed()) then
+ failure = (
+ "Mason package %s has incomplete receipt state; close all Neovim instances, "
+ .. "move %s aside as a backup, then rerun scripts/setup-nvim"
+ ):format(name, mason_root)
+ return true
+ end
+ if has_receipt then
+ local receipt = receipt_optional:get()
+ local source = receipt:get_source()
+ installed_source_id = source.id or "missing source id"
+ local canonical_ok, installed_canonical = pcall(canonical_purl, source.id)
+ source_matches = source.type == item.desired_source_type
+ and canonical_ok
+ and installed_canonical == item.desired_source_id
+ registry_matches = vim.deep_equal(receipt:get_registry(), item.desired_registry)
+ end
+ if has_receipt and source_matches and registry_matches then
+ -- Mason writes the receipt only after linking the final package.
+ elseif not item.attempted then
+ -- A missing receipt is an interrupted install. Any source or
+ -- registry mismatch is an unreviewed result. Reinstall both cases
+ -- from the pinned recipe without bypassing Mason's process lock.
+ item.attempted = true
+ package:install()
+ all_complete = false
+ else
+ failure = (
+ "Mason package %s did not converge: expected source %s from pinned registry, "
+ .. "found %s; close Neovim, move %s aside, and retry"
+ ):format(name, item.desired_source_id, installed_source_id, mason_root)
+ return true
+ end
+ end
+ end
+ return all_complete
+ end, 500)
+ assert(not failure, failure)
+ if not complete then
+ local locked = {}
+ for name, item in pairs(tracked) do
+ if item.external_lock then
+ table.insert(locked, name)
+ end
+ end
+ table.sort(locked)
+ assert(
+ #locked == 0,
+ ("timed out waiting for external Mason locks: %s; close other Neovim instances before retrying"):format(
+ table.concat(locked, ", ")
+ )
+ )
+ error("timed out waiting for " .. label)
+ end
+end
+
+local function refresh_mason_registry(timeout)
+ local registry = require("mason-registry")
+ local refreshed
+ registry.refresh(function(success)
+ refreshed = success
+ end)
+ assert(
+ vim.wait(timeout, function()
+ return refreshed ~= nil
+ end, 100),
+ "timed out refreshing the pinned Mason registry"
+ )
+ assert(refreshed, "failed to refresh the pinned Mason registry")
+end
+
+local function configured_lsp_packages(timeout)
+ local config_path = vim.fn.stdpath("config") .. "/init.lua"
+ vim.cmd.edit(vim.fn.fnameescape(config_path))
+
+ local settings = require("mason-lspconfig.settings")
+ local loaded = vim.wait(timeout, function()
+ local plugin = require("lazy.core.config").plugins["nvim-lspconfig"]
+ return plugin._.loaded ~= nil and #settings.current.ensure_installed > 0
+ end, 50)
+ assert(loaded, "timed out loading the configured LSP server list")
+ assert_unique("mason-lspconfig ensure_installed", settings.current.ensure_installed)
+
+ local mapping = require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package
+ local packages = {}
+ local seen = {}
+ for _, identifier in ipairs(settings.current.ensure_installed) do
+ local server = identifier:match("^[^@]+")
+ local package = mapping[server]
+ assert(package, ("no Mason package mapping for LSP server %q"):format(server))
+ if not seen[package] then
+ table.insert(packages, package)
+ seen[package] = true
+ end
+ end
+ return packages
+end
+
+local function wait_for_treesitter_parsers(timeout)
+ local parsers = LazyVim.opts("nvim-treesitter").ensure_installed
+ assert_unique("nvim-treesitter ensure_installed", parsers)
+
+ local treesitter = require("nvim-treesitter")
+ local complete = vim.wait(timeout, function()
+ local installed = {}
+ for _, name in ipairs(treesitter.get_installed("parsers")) do
+ installed[name] = true
+ end
+ for _, name in ipairs(parsers) do
+ if not installed[name] then
+ return false
+ end
+ end
+ return true
+ end, 500)
+ assert(complete, "timed out waiting for the curated Tree-sitter parsers")
+end
+
+local function assert_lazy_tasks()
+ for name, plugin in pairs(require("lazy.core.config").plugins) do
+ for _, task in ipairs(plugin._.tasks or {}) do
+ assert(not task:has_errors(), ("lazy task failed: %s/%s"):format(name, task.name))
+ end
+ end
+end
+
+local function main()
+ assert(require("lazy.core.config").plugins["nvim-treesitter"].build == false)
+ require("lazy.core.loader").load("mason.nvim", { cmd = "dotfiles setup" }, { force = true })
+ refresh_mason_registry(30000)
+ wait_for_mason_packages("the curated Mason tools", LazyVim.opts("mason.nvim").ensure_installed, 300000)
+ wait_for_mason_packages("the configured LSP servers", configured_lsp_packages(10000), 300000)
+ wait_for_treesitter_parsers(300000)
+
+ local uname = vim.uv.os_uname()
+ local linux_arm64 = uname.sysname == "Linux" and (uname.machine == "aarch64" or uname.machine == "arm64")
+ assert(not linux_arm64 or vim.fn.executable("clangd") == 1, "Linux arm64 requires a system clangd")
+
+ assert_lazy_tasks()
+end
+
+local ok, err = xpcall(main, debug.traceback)
+if not ok then
+ vim.api.nvim_err_writeln(err)
+ vim.cmd("cquit 1")
+end
+vim.cmd("qa")
diff --git a/scripts/nvim-preflight.lua b/scripts/nvim-preflight.lua
new file mode 100644
index 0000000..0bae908
--- /dev/null
+++ b/scripts/nvim-preflight.lua
@@ -0,0 +1,318 @@
+local function read_file(path)
+ local handle, open_error = io.open(path, "rb")
+ assert(handle, ("could not open %s: %s"):format(path, open_error or "unknown error"))
+ local contents = handle:read("*a")
+ handle:close()
+ return contents
+end
+
+local function run(command)
+ local result = vim.system(command, {
+ text = true,
+ env = {
+ GIT_ATTR_NOSYSTEM = "1",
+ GIT_CONFIG_GLOBAL = "/dev/null",
+ GIT_CONFIG_NOSYSTEM = "1",
+ GIT_NO_LAZY_FETCH = "1",
+ GIT_NO_REPLACE_OBJECTS = "1",
+ GIT_OPTIONAL_LOCKS = "0",
+ GIT_TERMINAL_PROMPT = "0",
+ },
+ }):wait(30000)
+ local output = vim.trim((result.stdout or "") .. (result.stderr or ""))
+ return result.code == 0, output
+end
+
+local function ensure_real_directory(path)
+ local stat = vim.uv.fs_lstat(path)
+ if stat then
+ assert(stat.type == "directory", "refusing non-directory or symlink path: " .. path)
+ return
+ end
+ local created, create_error = vim.uv.fs_mkdir(path, tonumber("700", 8))
+ assert(created, ("could not create %s: %s"):format(path, create_error or "unknown error"))
+end
+
+local function first_line(value)
+ return (value:match("[^\r\n]+") or value):sub(1, 240)
+end
+
+local function each_nul_record(value)
+ return value:gmatch("([^%z]+)")
+end
+
+local function metadata_file_reason(path, label)
+ local stat = vim.uv.fs_lstat(path)
+ if not stat then
+ return nil
+ end
+ if stat.type ~= "file" then
+ return label .. " is not a regular file"
+ end
+ local ok, contents = pcall(read_file, path)
+ if not ok then
+ return "could not read " .. label
+ end
+ for line in contents:gmatch("[^\r\n]+") do
+ if not line:match("^%s*$") and not line:match("^%s*#") then
+ return "active " .. label
+ end
+ end
+ return nil
+end
+
+local function allowed_local_config(key)
+ return vim.tbl_contains({
+ "core.autocrlf",
+ "core.bare",
+ "core.filemode",
+ "core.ignorecase",
+ "core.logallrefupdates",
+ "core.precomposeunicode",
+ "core.repositoryformatversion",
+ "remote.origin.fetch",
+ "remote.origin.partialclonefilter",
+ "remote.origin.promisor",
+ "remote.origin.url",
+ "submodule.active",
+ }, key) or key:match("^branch%..+%.merge$") ~= nil or key:match("^branch%..+%.remote$") ~= nil
+end
+
+local function checkout_metadata_reason(git, git_dir)
+ local config_command =
+ vim.list_extend(vim.deepcopy(git), { "config", "--local", "--no-includes", "--name-only", "--null", "--list" })
+ local config_ok, config_names = run(config_command)
+ if not config_ok then
+ return "unreadable local Git config: " .. first_line(config_names)
+ end
+ for name in each_nul_record(config_names) do
+ local key = name:lower()
+ if not allowed_local_config(key) then
+ return "unsupported local Git config: " .. key
+ end
+ end
+
+ for _, item in ipairs({
+ { git_dir .. "/info/attributes", "Git info attributes" },
+ { git_dir .. "/info/exclude", "Git info excludes" },
+ { git_dir .. "/objects/info/alternates", "Git object alternates" },
+ { git_dir .. "/objects/info/http-alternates", "Git HTTP object alternates" },
+ }) do
+ local reason = metadata_file_reason(item[1], item[2])
+ if reason then
+ return reason
+ end
+ end
+
+ local hooks_path = git_dir .. "/hooks"
+ local hooks_stat = vim.uv.fs_lstat(hooks_path)
+ if hooks_stat then
+ if hooks_stat.type ~= "directory" then
+ return "Git hooks path is not a regular directory"
+ end
+ local scanner, scan_error = vim.uv.fs_scandir(hooks_path)
+ if not scanner then
+ return "could not inspect Git hooks: " .. (scan_error or "unknown error")
+ end
+ while true do
+ local hook = vim.uv.fs_scandir_next(scanner)
+ if not hook then
+ break
+ end
+ if not hook:match("%.sample$") then
+ return "non-sample Git hook metadata: " .. hook
+ end
+ end
+ end
+
+ local replace_command =
+ vim.list_extend(vim.deepcopy(git), { "for-each-ref", "--format=%(refname)", "refs/replace" })
+ local replace_ok, replace_refs = run(replace_command)
+ if not replace_ok then
+ return "unreadable Git replacement refs: " .. first_line(replace_refs)
+ end
+ if replace_refs ~= "" then
+ return "Git replacement refs are present"
+ end
+ return nil
+end
+
+local function allowed_generated_path(path)
+ return path == "doc/tags" or path:match("^doc/tags%-%w[%w._-]*$") ~= nil
+end
+
+local function main()
+ local lock_path = vim.fn.stdpath("config") .. "/lazy-lock.json"
+ local decoded_ok, lock = pcall(vim.json.decode, read_file(lock_path))
+ assert(decoded_ok and type(lock) == "table", "invalid Neovim lock file: " .. lock_path)
+
+ local names = vim.tbl_keys(lock)
+ table.sort(names)
+ assert(#names > 0, "Neovim lock file is empty: " .. lock_path)
+
+ local lazy_root = vim.fn.stdpath("data") .. "/lazy"
+ local lazy_stat = vim.uv.fs_lstat(lazy_root)
+ if not lazy_stat then
+ print("Neovim plugin preflight: cold data root; nothing to quarantine.")
+ return
+ end
+ assert(lazy_stat.type == "directory", "refusing non-directory or symlink plugin root: " .. lazy_root)
+
+ local drifted = {}
+ for _, name in ipairs(names) do
+ assert(name:match("^[%w][%w._-]*$"), "unsafe plugin name in lazy-lock.json: " .. name)
+ local entry = lock[name]
+ assert(type(entry) == "table", "invalid lock entry for " .. name)
+ assert(
+ type(entry.commit) == "string" and entry.commit:match("^[0-9a-f]+$") and #entry.commit == 40,
+ "invalid commit in lock entry for " .. name
+ )
+
+ local plugin_path = lazy_root .. "/" .. name
+ local stat = vim.uv.fs_lstat(plugin_path)
+ if stat then
+ assert(stat.type == "directory", "refusing non-directory or symlink plugin checkout: " .. plugin_path)
+
+ local git_dir = plugin_path .. "/.git"
+ local git_stat = vim.uv.fs_lstat(git_dir)
+ local git = {
+ "git",
+ "--no-replace-objects",
+ "-c",
+ "core.fsmonitor=false",
+ "-c",
+ "core.hooksPath=/dev/null",
+ "-c",
+ "core.trustctime=true",
+ "-c",
+ "core.checkStat=default",
+ "-c",
+ "core.ignoreStat=false",
+ "--git-dir=" .. git_dir,
+ "--work-tree=" .. plugin_path,
+ }
+ local reason = not git_stat and "missing .git directory"
+ or git_stat.type ~= "directory" and "non-directory or linked .git metadata"
+ or checkout_metadata_reason(git, git_dir)
+ local head_ok = false
+ local head = "unknown"
+ if not reason then
+ local head_command = vim.list_extend(vim.deepcopy(git), { "rev-parse", "--verify", "HEAD" })
+ head_ok, head = run(head_command)
+ if not head_ok then
+ reason = "unreadable Git checkout: " .. first_line(head)
+ elseif head ~= entry.commit then
+ reason = ("commit %s, expected %s"):format(head, entry.commit)
+ end
+ end
+ if not reason then
+ local status_command = vim.list_extend(
+ vim.deepcopy(git),
+ { "status", "--porcelain=v1", "--untracked-files=no", "--ignore-submodules=all" }
+ )
+ local status_ok, status = run(status_command)
+ if not status_ok then
+ reason = "unreadable Git status: " .. first_line(status)
+ elseif status ~= "" then
+ reason = "tracked or staged working-tree changes"
+ end
+ end
+ if not reason then
+ local index_command = vim.list_extend(vim.deepcopy(git), { "ls-files", "-v", "-z" })
+ local index_ok, index_flags = run(index_command)
+ if not index_ok then
+ reason = "unreadable Git index: " .. first_line(index_flags)
+ else
+ for record in each_nul_record(index_flags) do
+ local tag = record:sub(1, 1)
+ if tag == "S" or tag:match("%l") then
+ reason = ("index flag %s on %s"):format(tag, record:sub(3))
+ break
+ end
+ end
+ end
+ end
+ if not reason then
+ local stage_command = vim.list_extend(vim.deepcopy(git), { "ls-files", "-s", "-z" })
+ local stage_ok, stages = run(stage_command)
+ if not stage_ok then
+ reason = "unreadable Git stages: " .. first_line(stages)
+ else
+ for record in each_nul_record(stages) do
+ local mode, _, stage, path = record:match("^(%d+) ([0-9a-f]+) (%d+)\t(.*)$")
+ if not mode then
+ reason = "malformed Git index entry"
+ elseif stage ~= "0" then
+ reason = "unmerged Git index entry: " .. path
+ elseif mode == "160000" then
+ reason = "Git submodule checkout requires recursive verification: " .. path
+ end
+ if reason then
+ break
+ end
+ end
+ end
+ end
+ if not reason then
+ local extras_command = vim.list_extend(vim.deepcopy(git), { "ls-files", "--others", "-z" })
+ local extras_ok, extras = run(extras_command)
+ if not extras_ok then
+ reason = "unreadable untracked paths: " .. first_line(extras)
+ else
+ for path in each_nul_record(extras) do
+ if not allowed_generated_path(path) then
+ reason = "untracked or ignored path: " .. path
+ break
+ end
+ end
+ end
+ end
+
+ if reason then
+ table.insert(drifted, {
+ name = name,
+ path = plugin_path,
+ head = head_ok and head or "unknown",
+ reason = reason,
+ })
+ end
+ end
+ end
+
+ if #drifted == 0 then
+ print("Neovim plugin preflight: every existing checkout matches the reviewed lock.")
+ return
+ end
+
+ local quarantine_base = vim.fn.stdpath("data") .. "/dotfiles-quarantine"
+ ensure_real_directory(quarantine_base)
+ local quarantine = quarantine_base .. "/" .. os.date("!%Y%m%dT%H%M%SZ") .. "-" .. vim.fn.getpid()
+ ensure_real_directory(quarantine)
+
+ local manifest_path = quarantine .. "/MANIFEST.tsv"
+ local manifest, manifest_error = io.open(manifest_path, "wb")
+ assert(manifest, ("could not create %s: %s"):format(manifest_path, manifest_error or "unknown error"))
+ manifest:write("plugin\tprevious_head\treason\n")
+ manifest:flush()
+
+ for _, item in ipairs(drifted) do
+ local destination = quarantine .. "/" .. item.name
+ local renamed, rename_error = vim.uv.fs_rename(item.path, destination)
+ assert(
+ renamed,
+ ("could not quarantine %s at %s: %s"):format(item.name, destination, rename_error or "unknown error")
+ )
+ local reason = item.reason:gsub("[\t\r\n]", " ")
+ manifest:write(("%s\t%s\t%s\n"):format(item.name, item.head, reason))
+ manifest:flush()
+ print(("Quarantined Neovim plugin %s: %s"):format(item.name, reason))
+ end
+ manifest:close()
+ print("Preserved previous plugin checkouts at " .. quarantine)
+end
+
+local ok, err = xpcall(main, debug.traceback)
+if not ok then
+ vim.api.nvim_err_writeln("Neovim plugin preflight failed:\n" .. err)
+ vim.cmd("cquit 1")
+end
diff --git a/scripts/restore b/scripts/restore
new file mode 100755
index 0000000..edf876b
--- /dev/null
+++ b/scripts/restore
@@ -0,0 +1,230 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
+# shellcheck disable=SC1091
+source "$script_dir/lib/safety.bash"
+
+restore_apply=0
+restore_remove_created=0
+restore_destination=
+restore_backup_dir=
+restore_stage=
+restore_stage_parent=
+restore_directory_paths=()
+restore_directory_modes=()
+
+usage() {
+ cat <<'EOF'
+Usage: scripts/restore [--destination DIR] [--apply] [--remove-created] BACKUP
+
+Preview or restore a backup created by scripts/backup. The default is a
+read-only preview. --apply restores pre-existing regular files, symlinks, and
+recorded directory permission modes.
+--remove-created additionally removes regular files/symlinks that the backup
+recorded as absent; it never removes directories and requires --apply.
+EOF
+}
+
+cleanup_stage() {
+ if [[ -n $restore_stage && -n $restore_stage_parent ]]; then
+ case "$restore_stage" in
+ "$restore_stage_parent"/.dotfiles-restore.*)
+ [[ -L $restore_stage || ! -d $restore_stage ]] && rm -f -- "$restore_stage"
+ ;;
+ esac
+ restore_stage=
+ restore_stage_parent=
+ fi
+}
+
+exit_for_signal() {
+ local status=$1
+
+ trap - HUP INT TERM
+ cleanup_stage || true
+ trap - EXIT
+ exit "$status"
+}
+
+trap cleanup_stage EXIT
+trap 'exit_for_signal 129' HUP
+trap 'exit_for_signal 130' INT
+trap 'exit_for_signal 143' TERM
+
+while (($# > 0)); do
+ case $1 in
+ --apply)
+ restore_apply=1
+ shift
+ ;;
+ --remove-created)
+ restore_remove_created=1
+ shift
+ ;;
+ --destination)
+ (($# >= 2)) || dotfiles_die '--destination requires an argument'
+ restore_destination=$2
+ shift 2
+ ;;
+ --destination=*)
+ restore_destination=${1#*=}
+ shift
+ ;;
+ -h | --help)
+ usage
+ exit 0
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ dotfiles_die "unknown argument: $1"
+ ;;
+ *)
+ [[ -z $restore_backup_dir ]] || dotfiles_die 'only one backup directory may be specified'
+ restore_backup_dir=$1
+ shift
+ ;;
+ esac
+done
+
+if (($# > 0)); then
+ [[ -z $restore_backup_dir && $# -eq 1 ]] || dotfiles_die 'only one backup directory may be specified'
+ restore_backup_dir=$1
+fi
+
+[[ -n $restore_backup_dir ]] || dotfiles_die 'a backup directory is required'
+((restore_remove_created == 0 || restore_apply == 1)) ||
+ dotfiles_die '--remove-created requires --apply'
+
+restore_backup_dir=$(dotfiles_existing_directory "$restore_backup_dir" 'backup directory')
+restore_manifest="$restore_backup_dir/manifest.tsv"
+restore_metadata="$restore_backup_dir/metadata"
+[[ -f $restore_manifest && ! -L $restore_manifest ]] ||
+ dotfiles_die "missing regular manifest: $restore_manifest"
+[[ -f $restore_metadata && ! -L $restore_metadata ]] ||
+ dotfiles_die "missing regular metadata: $restore_metadata"
+
+recorded_format=
+recorded_destination=
+while IFS='=' read -r metadata_key metadata_value; do
+ case $metadata_key in
+ format) recorded_format=$metadata_value ;;
+ destination) recorded_destination=$metadata_value ;;
+ esac
+done <"$restore_metadata"
+[[ $recorded_format == 1 || $recorded_format == 2 ]] ||
+ dotfiles_die "unsupported backup format: $recorded_format"
+
+if [[ -z $restore_destination ]]; then
+ restore_destination=$recorded_destination
+fi
+[[ -n $restore_destination ]] || dotfiles_die 'backup does not record a destination; pass --destination'
+restore_destination=$(dotfiles_existing_directory "$restore_destination" 'restore destination')
+
+if [[ -n $recorded_destination && $restore_destination != "$recorded_destination" ]]; then
+ printf 'warning: restoring to %s instead of recorded destination %s\n' \
+ "$restore_destination" "$recorded_destination" >&2
+fi
+
+restore_count=0
+restore_directory_count=0
+remove_count=0
+leave_count=0
+leave_directory_count=0
+while IFS=$'\t' read -r record_state managed_path manifest_extra || [[ -n $record_state ]]; do
+ dotfiles_validate_relative_path "$managed_path"
+ dotfiles_assert_safe_parent_chain "$restore_destination" "$managed_path"
+ restore_target="$restore_destination/$managed_path"
+
+ case $record_state in
+ present)
+ [[ -z ${manifest_extra:-} ]] || dotfiles_die 'present manifest record contains an extra field'
+ restore_source="$restore_backup_dir/files/$managed_path"
+ dotfiles_assert_safe_parent_chain "$restore_backup_dir/files" "$managed_path"
+ if [[ ! -f $restore_source && ! -L $restore_source ]]; then
+ dotfiles_die "backup payload is missing or unsupported: $restore_source"
+ fi
+ printf '%s restore %s\n' "$([[ $restore_apply == 1 ]] && printf apply || printf plan)" "$managed_path"
+ if ((restore_apply == 1)); then
+ restore_stage_parent=$(dirname -- "$restore_target")
+ mkdir -p -- "$restore_stage_parent"
+ dotfiles_assert_safe_parent_chain "$restore_destination" "$managed_path"
+ if [[ -d $restore_target && ! -L $restore_target ]]; then
+ dotfiles_die "refusing to replace a real directory target: $restore_target"
+ fi
+ restore_stage=$(mktemp "$restore_stage_parent/.dotfiles-restore.XXXXXXXX")
+ rm -f -- "$restore_stage"
+ cp -pPR -- "$restore_source" "$restore_stage"
+ if [[ -d $restore_target && ! -L $restore_target ]]; then
+ dotfiles_die "restore target became a real directory: $restore_target"
+ fi
+ dotfiles_atomic_replace "$restore_stage" "$restore_target"
+ restore_stage=
+ restore_stage_parent=
+ fi
+ restore_count=$((restore_count + 1))
+ ;;
+ absent)
+ [[ -z ${manifest_extra:-} ]] || dotfiles_die 'absent manifest record contains an extra field'
+ if ((restore_remove_created == 1)); then
+ printf '%s remove-created %s\n' "$([[ $restore_apply == 1 ]] && printf apply || printf plan)" "$managed_path"
+ if [[ -e $restore_target || -L $restore_target ]]; then
+ if [[ -d $restore_target && ! -L $restore_target ]]; then
+ dotfiles_die "refusing to remove a directory: $restore_target"
+ fi
+ rm -f -- "$restore_target"
+ remove_count=$((remove_count + 1))
+ fi
+ else
+ printf 'plan leave-created %s\n' "$managed_path"
+ leave_count=$((leave_count + 1))
+ fi
+ ;;
+ directory)
+ [[ $recorded_format == 2 ]] || dotfiles_die 'directory record requires backup format 2'
+ [[ ${manifest_extra:-} =~ ^[0-7]{3,4}$ ]] ||
+ dotfiles_die "invalid recorded directory mode for $managed_path: ${manifest_extra:-}"
+ printf '%s restore-directory-mode %s %s\n' \
+ "$([[ $restore_apply == 1 ]] && printf apply || printf plan)" \
+ "$managed_path" "$manifest_extra"
+ restore_directory_paths+=("$managed_path")
+ restore_directory_modes+=("$manifest_extra")
+ restore_directory_count=$((restore_directory_count + 1))
+ ;;
+ absent-directory)
+ [[ $recorded_format == 2 ]] || dotfiles_die 'absent-directory record requires backup format 2'
+ [[ -z ${manifest_extra:-} ]] || dotfiles_die 'absent-directory record contains an extra field'
+ printf 'plan leave-created-directory %s\n' "$managed_path"
+ leave_directory_count=$((leave_directory_count + 1))
+ ;;
+ *)
+ dotfiles_die "invalid manifest state: $record_state"
+ ;;
+ esac
+done <"$restore_manifest"
+
+if ((restore_apply == 1)); then
+ # Files are restored first. Apply directory modes from deepest to shallowest
+ # so a restrictive parent never blocks restoration below it.
+ for ((index = ${#restore_directory_paths[@]} - 1; index >= 0; index--)); do
+ managed_path=${restore_directory_paths[$index]}
+ directory_mode=${restore_directory_modes[$index]}
+ dotfiles_assert_safe_parent_chain "$restore_destination" "$managed_path"
+ restore_target="$restore_destination/$managed_path"
+ [[ -d $restore_target && ! -L $restore_target ]] ||
+ dotfiles_die "recorded directory is missing or no longer a directory: $restore_target"
+ chmod "$directory_mode" "$restore_target"
+ done
+fi
+
+if ((restore_apply == 1)); then
+ printf 'Restored %d file/symlink target(s) and %d directory mode(s); removed %d newly-created target(s).\n' \
+ "$restore_count" "$restore_directory_count" "$remove_count" >&2
+else
+ printf 'Previewed %d file/symlink restore(s) and %d directory mode restore(s); %d newly-created target(s) and %d directories would remain.\n' \
+ "$restore_count" "$restore_directory_count" "$leave_count" "$leave_directory_count" >&2
+fi
diff --git a/scripts/setup-nvim b/scripts/setup-nvim
new file mode 100755
index 0000000..9f4b807
--- /dev/null
+++ b/scripts/setup-nvim
@@ -0,0 +1,120 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+repo_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)
+active_child=
+setup_lock=
+lock_owned=0
+
+cleanup() {
+ if ((lock_owned == 1)) && [[ -n $setup_lock ]]; then
+ if [[ -f $setup_lock/pid ]] && [[ $(<"$setup_lock/pid") == "$$" ]]; then
+ rm -f -- "$setup_lock/pid"
+ fi
+ rmdir -- "$setup_lock" 2>/dev/null || true
+ lock_owned=0
+ fi
+}
+
+handle_signal() {
+ local status=$1
+ trap - HUP INT TERM
+ if [[ -n $active_child ]]; then
+ kill -TERM "$active_child" 2>/dev/null || true
+ wait "$active_child" 2>/dev/null || true
+ active_child=
+ fi
+ cleanup
+ trap - EXIT
+ exit "$status"
+}
+
+run_child() {
+ local status=0
+ "$@" &
+ active_child=$!
+ wait "$active_child" || status=$?
+ active_child=
+ return "$status"
+}
+
+trap cleanup EXIT
+trap 'handle_signal 129' HUP
+trap 'handle_signal 130' INT
+trap 'handle_signal 143' TERM
+
+if ! command -v nvim >/dev/null 2>&1; then
+ printf 'Neovim is required; install the supported version first.\n' >&2
+ exit 1
+fi
+
+# These are private script locations, never caller configuration.
+unset DOTFILES_NVIM_PREFLIGHT_SCRIPT DOTFILES_NVIM_SETUP_SCRIPT
+# Repository-scoping Git variables commonly leak from bare-repository shell
+# workflows and override every `git -C` used by the plugin manager. They are
+# never meaningful for this provisioner. Config-count and template injection
+# are also process-local input channels, so do not pass them into plugin clones.
+unset \
+ GIT_ALTERNATE_OBJECT_DIRECTORIES \
+ GIT_COMMON_DIR \
+ GIT_CONFIG \
+ GIT_CONFIG_COUNT \
+ GIT_CONFIG_PARAMETERS \
+ GIT_DIR \
+ GIT_DIFF_OPTS \
+ GIT_EXTERNAL_DIFF \
+ GIT_INDEX_FILE \
+ GIT_NAMESPACE \
+ GIT_OBJECT_DIRECTORY \
+ GIT_REPLACE_REF_BASE \
+ GIT_SHALLOW_FILE \
+ GIT_TEMPLATE_DIR \
+ GIT_WORK_TREE
+
+# Provision only the reviewed public repositories. Personal and system Git
+# configuration can otherwise inject hooks, templates, clean/smudge filters,
+# attributes, or fsmonitor commands into a brand-new checkout before the
+# preflight has a chance to inspect it. Keep standard proxy environment
+# variables available, but make Git's executable/content-changing inputs
+# explicit for both the preflight and every clone performed by Neovim.
+export GIT_ATTR_NOSYSTEM=1
+export GIT_CONFIG_GLOBAL=/dev/null
+export GIT_CONFIG_NOSYSTEM=1
+export GIT_NO_REPLACE_OBJECTS=1
+export GIT_TERMINAL_PROMPT=0
+export GIT_CONFIG_COUNT=3
+export GIT_CONFIG_KEY_0=core.hooksPath
+export GIT_CONFIG_VALUE_0=/dev/null
+export GIT_CONFIG_KEY_1=core.fsmonitor
+export GIT_CONFIG_VALUE_1=false
+export GIT_CONFIG_KEY_2=core.attributesFile
+export GIT_CONFIG_VALUE_2=/dev/null
+export DOTFILES_NVIM_PREFLIGHT_SCRIPT="$repo_root/scripts/nvim-preflight.lua"
+export DOTFILES_NVIM_SETUP_SCRIPT="$repo_root/scripts/nvim-first-start.lua"
+export NVIM_APPNAME=nvim
+
+# Hold one provisioner across preflight and readiness. A stale directory is
+# kept for manual inspection instead of guessing whether another process owns
+# it; remove it only after confirming no setup-nvim process is active.
+state_home=${XDG_STATE_HOME:-${HOME:?HOME is required}/.local/state}
+lock_parent="$state_home/nvim"
+mkdir -p -- "$lock_parent"
+setup_lock="$lock_parent/dotfiles-setup.lock"
+if ! mkdir -- "$setup_lock" 2>/dev/null; then
+ printf 'Another Neovim setup may be active; lock exists at %s\n' "$setup_lock" >&2
+ printf 'Close other setup/Neovim processes before removing a stale lock.\n' >&2
+ exit 1
+fi
+lock_owned=1
+printf '%s\n' "$$" >"$setup_lock/pid"
+
+# This clean process cannot load plugin code. It preserves every mismatched or
+# locally modified checkout in an atomic quarantine, so the normal process can
+# install the reviewed commits without ever executing the previous graph.
+printf 'Checking the installed plugin graph against the reviewed lock.\n'
+run_child nvim --clean --headless -u NONE \
+ '+lua dofile(vim.env.DOTFILES_NVIM_PREFLIGHT_SCRIPT)' +qa
+
+printf 'Provisioning the reviewed plugin and toolchain graph.\n'
+run_child nvim --headless '+lua dofile(vim.env.DOTFILES_NVIM_SETUP_SCRIPT)'
diff --git a/theme/preview.svg b/theme/preview.svg
new file mode 100644
index 0000000..3818654
--- /dev/null
+++ b/theme/preview.svg
@@ -0,0 +1,32 @@
+
diff --git a/theme/solarized-osaka.toml b/theme/solarized-osaka.toml
new file mode 100644
index 0000000..af665d3
--- /dev/null
+++ b/theme/solarized-osaka.toml
@@ -0,0 +1,29 @@
+name = "Solarized Osaka"
+source = "https://github.com/craftzdog/solarized-osaka.nvim"
+revision = "f796014c14b1910e08d42cc2077fef34f08e0295"
+license = "Apache-2.0"
+license_path = "third_party/solarized-osaka/LICENSE"
+license_sha256 = "9d6646760f242c7797b148512f0cdaf71ecb6ba6fa9be2a0ca2dc09aec1aed7c"
+
+[primary]
+background = "#001419"
+foreground = "#839395"
+opacity = 0.9
+
+[ansi]
+black = "#001014"
+red = "#db302d"
+green = "#849900"
+yellow = "#b28500"
+blue = "#268bd3"
+magenta = "#d23681"
+cyan = "#29a298"
+white = "#839395"
+
+[ui]
+surface = "#002c38"
+base02 = "#063540"
+base01 = "#576d74"
+base0 = "#9eabac"
+base2 = "#ede7d3"
+white = "#ffffff"
diff --git a/third_party/hsl-color/LICENSE b/third_party/hsl-color/LICENSE
new file mode 100644
index 0000000..1f5bc11
--- /dev/null
+++ b/third_party/hsl-color/LICENSE
@@ -0,0 +1,39 @@
+Copyright 2011 Emmanuel Oga.
+
+Licensed under a Creative Commons Attribution 3.0
+Unported License (http://creativecommons.org/licenses/by/3.0/).
+
+You are free:
+
+ to Share — to copy, distribute and transmit the work
+ to Remix — to adapt the work
+
+Under the following conditions:
+
+ Attribution — You must attribute the work in the manner specified by the author
+ or licensor (but not in any way that suggests that they endorse you or your use
+ of the work).
+
+With the understanding that:
+
+ Waiver — Any of the above conditions can be waived if you get permission from
+ the copyright holder.
+
+ Public Domain — Where the work or any of its elements is in the public domain
+ under applicable law, that status is in no way affected by the license.
+
+ Other Rights — In no way are any of the following rights affected by the
+ license:
+
+ Your fair dealing or fair use rights, or other applicable copyright exceptions
+ and limitations;
+
+ The author's moral rights;
+ Rights other persons may have either in the work itself or in how the work is
+ used, such as publicity or privacy rights.
+
+ Notice — For any reuse or distribution, you must make clear to others the
+ license terms of this work. The best way to do this is with a link to this web
+ page.
+
+This is a human-readable summary of the full license at http://creativecommons.org/licenses/by/3.0/legalcode
diff --git a/third_party/hsl-color/UPSTREAM.toml b/third_party/hsl-color/UPSTREAM.toml
new file mode 100644
index 0000000..20dde0d
--- /dev/null
+++ b/third_party/hsl-color/UPSTREAM.toml
@@ -0,0 +1,20 @@
+name = "columns color.lua"
+source = "https://github.com/EmmanuelOga/columns"
+revision = "836312be76b85b7f85e0cb2c31f5f22624c62d3e"
+upstream_path = "utils/color.lua"
+upstream_sha256 = "46497e998a8fba66d2b35f0faaef947069c58ce1692698cb43fb255af026e7b1"
+license = "CC-BY-3.0"
+license_path = "third_party/hsl-color/LICENSE"
+license_sha256 = "2a97b6c436d78be028a88a0d4fa39fa10e8aa96686d1055c1303ea51fb71bbd3"
+attribution = "RGB/HSL conversion math by Emmanuel Oga, adapted for this Neovim configuration."
+
+modifications = [
+ "Kept the RGB/HSL conversion math and integrated it into a Neovim line action.",
+ "Added explicit 3- and 6-digit hexadecimal validation and short-form expansion.",
+ "Rejected unsupported hexadecimal lengths instead of truncating them.",
+ "Made helper functions local, rounded RGB bytes safely, and added pure-Lua regression tests.",
+]
+
+[deployed]
+path = "home/dot_config/nvim/lua/m1ngsama/hsl.lua"
+sha256 = "0a446c0074bec8c935e0d7203cba420c1b88a0ca02364ba943e1c8e54b94f49b"
diff --git a/third_party/nvm.fish/LICENSE.md b/third_party/nvm.fish/LICENSE.md
new file mode 100644
index 0000000..6ba7a0f
--- /dev/null
+++ b/third_party/nvm.fish/LICENSE.md
@@ -0,0 +1,7 @@
+Copyright © Jorge Bucaran <>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/third_party/nvm.fish/UPSTREAM.toml b/third_party/nvm.fish/UPSTREAM.toml
new file mode 100644
index 0000000..36ddd4f
--- /dev/null
+++ b/third_party/nvm.fish/UPSTREAM.toml
@@ -0,0 +1,16 @@
+name = "nvm.fish"
+version = "2.2.17"
+source = "https://github.com/jorgebucaran/nvm.fish"
+revision = "abd3002b6d2d578d484a5aea94dd1517dded6d42"
+license = "MIT"
+license_path = "third_party/nvm.fish/LICENSE.md"
+license_sha256 = "f101c761d255d0dddc77dd8a9327733b03d381798ec54a1bb718367207b48a8e"
+
+[files]
+"home/dot_config/fish/conf.d/nvm.fish" = "28a058e877d82c68ad0c65fa69fc392daacab66bf15539d0051e6b48b6dee8d4"
+"home/dot_config/fish/completions/nvm.fish" = "75b5b7e36083f6649fcad578798fcc6d23c189e86f19aca9bee2296e26415853"
+"home/dot_config/fish/functions/_nvm_index_update.fish" = "06df8720ead8d28bc1c39e6611e4fc8134e57d4668be460c08617f0cbf91e5b1"
+"home/dot_config/fish/functions/_nvm_list.fish" = "6773687d1ed846630d96472d8684c1fac57ca6a3c9c3c66f3aa75bed63be88c9"
+"home/dot_config/fish/functions/_nvm_version_activate.fish" = "3cff7eb9b28dad689e73b164a57ba6bf0d5f88b6d962580f8409e1779d0e8fa0"
+"home/dot_config/fish/functions/_nvm_version_deactivate.fish" = "cd9aec256fafc24e0b4eefafcc3c0bfb6725d1a6bbe5acc38f7b36d15bab7e63"
+"home/dot_config/fish/functions/nvm.fish" = "999ad75d5f9454855b008390b8a5f4536a0ae4f27a0998863c3b94a2d6c77c27"
diff --git a/third_party/ranger-scope/LICENSE b/third_party/ranger-scope/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/third_party/ranger-scope/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/third_party/ranger-scope/UPSTREAM.toml b/third_party/ranger-scope/UPSTREAM.toml
new file mode 100644
index 0000000..28896dc
--- /dev/null
+++ b/third_party/ranger-scope/UPSTREAM.toml
@@ -0,0 +1,24 @@
+name = "ranger scope.sh"
+version = "1.9.4"
+source = "https://github.com/ranger/ranger"
+revision = "55fc2839f693aed9486d211694d7317d78161341"
+upstream_path = "ranger/data/scope.sh"
+upstream_sha256 = "141bf1d096d0e94367f566ac05578b49248c60af6bb537c60b492f5db3b58408"
+license = "GPL-3.0-only"
+license_path = "third_party/ranger-scope/LICENSE"
+license_sha256 = "8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903"
+security_reference = "https://github.com/ranger/ranger/issues/3231"
+
+modifications = [
+ "Reformatted with the repository shell style.",
+ "Added GNU/BSD stat compatibility for text preview size checks.",
+ "Added application/javascript to the text MIME preview branch.",
+ "Replaced the predictable /tmp font preview path (CWE-377) with a private mktemp directory and trap cleanup.",
+ "Enabled guarded ffmpegthumbnailer video thumbnails and Poppler PDF image previews.",
+ "Added guarded chafa previews for images and generated video or PDF thumbnails when graphical previews are disabled.",
+ "Guarded optional media metadata, conversion, and font commands and fall back to file classification when they are unavailable.",
+]
+
+[deployed]
+path = "home/dot_config/ranger/executable_scope.sh"
+sha256 = "6ceec6d6db3309c6cd98832824c3d9d8f983d94e14beb8475fd93e9a5ca76a81"
diff --git a/third_party/solarized-osaka/LICENSE b/third_party/solarized-osaka/LICENSE
new file mode 100644
index 0000000..89e83dd
--- /dev/null
+++ b/third_party/solarized-osaka/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2024 Takuya Matsuyama
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/tmux/statusline.conf b/tmux/statusline.conf
deleted file mode 100644
index f2a2ee5..0000000
--- a/tmux/statusline.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-# vim: ft=tmux
-set -g mode-style "fg=#eee8d5,bg=#073642"
-
-set -g message-style "fg=#eee8d5,bg=#073642"
-set -g message-command-style "fg=#eee8d5,bg=#073642"
-
-set -g pane-border-style "fg=#073642"
-set -g pane-active-border-style "fg=#eee8d5"
-
-set -g status "on"
-set -g status-interval 1
-set -g status-justify "left"
-
-set -g status-style "fg=#586e75,bg=#073642"
-
-set -g status-bg "#002b36"
-
-set -g status-left-length "100"
-set -g status-right-length "100"
-
-set -g status-left-style NONE
-set -g status-right-style NONE
-
-set -g status-left "#[fg=#073642,bg=#eee8d5,bold] #S #[fg=#eee8d5,bg=#93a1a1,nobold,nounderscore,noitalics]#[fg=#15161E,bg=#93a1a1,bold] #(whoami) #[fg=#93a1a1,bg=#002b36]"
-set -g status-right "#[fg=#586e75,bg=#002b36,nobold,nounderscore,noitalics]#[fg=#93a1a1,bg=#586e75]#[fg=#657b83,bg=#586e75,nobold,nounderscore,noitalics]#[fg=#93a1a1,bg=#657b83]#[fg=#93a1a1,bg=#657b83,nobold,nounderscore,noitalics]#[fg=#15161E,bg=#93a1a1,bold] #h "
-
-setw -g window-status-activity-style "underscore,fg=#839496,bg=#002b36"
-setw -g window-status-separator ""
-setw -g window-status-style "NONE,fg=#839496,bg=#002b36"
-setw -g window-status-format '#[fg=#002b36,bg=#002b36]#[default] #I #{b:pane_current_path} #[fg=#002b36,bg=#002b36,nobold,nounderscore,noitalics]'
-setw -g window-status-current-format '#[fg=#002b36,bg=#eee8d5]#[fg=#b58900,bg=#eee8d5] #I #[fg=#eee8d5,bg=#b58900] #{b:pane_current_path} #[fg=#b58900,bg=#002b36,nobold]'
diff --git a/tmux/theme.conf b/tmux/theme.conf
deleted file mode 100644
index 37a022c..0000000
--- a/tmux/theme.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-#### COLOUR (Solarized 256)
-
-# default statusbar colors
-set-option -g status-style bg=colour235,fg=colour136,default
-
-# default window title colors
-set-window-option -g window-status-style fg=colour244,bg=colour234,dim
-
-# active window title colors
-set-window-option -g window-status-current-style fg=colour166,bg=default,bright
-
-# pane border
-set-option -g pane-border-style fg=colour235 #base02
-set-option -g pane-active-border-style fg=colour136,bg=colour235
-
-# message text
-set-option -g message-style bg=colour235,fg=colour166
-
-# pane number display
-set-option -g display-panes-active-colour colour33 #blue
-set-option -g display-panes-colour colour166 #orange
-
-# clock
-set-window-option -g clock-mode-colour colour64 #green
diff --git a/tmux/tmux.conf b/tmux/tmux.conf
deleted file mode 100644
index 5c178d3..0000000
--- a/tmux/tmux.conf
+++ /dev/null
@@ -1,71 +0,0 @@
-#set -g default-terminal "tmux-256color"
-set -g default-terminal "xterm-256color"
-#set -ga terminal-overrides ",*256col*:Tc"
-set -ga terminal-overrides ",xterm-256color:Tc"
-# action key
-unbind C-b
-set-option -g prefix C-t
-set-option -g repeat-time 0
-set-option -g focus-events on
-
-#### Key bindings
-
-set-window-option -g mode-keys vi
-
-#bind a send-key C-t
-# Reload settings
-bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded!"
-# Open current directory
-bind o run-shell "open '#{pane_current_path}'"
-bind -r e kill-pane -a
-
-# Select window
-bind h select-pane -L
-bind j select-pane -D
-bind k select-pane -U
-bind l select-pane -R
-
-# Moving window
-bind -r H resize-pane -L 5
-bind -r J resize-pane -D 3
-bind -r K resize-pane -U 3
-bind -r L resize-pane -R 5
-
-# Split window
-bind | split-window -h # Ctrl-a |
-bind - split-window -v # Ctrl-a -
-bind x kill-pane # Ctrl-a x
-bind X kill-window # Ctrl-a X
-
-#### basic settings
-
-set-option -g status-justify "left"
-#set-option utf8-default on
-#set-option -g mouse-select-pane
-set-window-option -g mode-keys vi
-#set-window-option -g utf8 on
-# look'n feel
-set-option -g status-fg cyan
-set-option -g status-bg black
-set -g pane-active-border-style fg=colour166,bg=default
-set -g window-style fg=colour10,bg=default
-set -g window-active-style fg=colour12,bg=default
-set-option -g history-limit 64096
-
-set -sg escape-time 10
-
-
-# allow the title bar to adapt to whatever host you connect to
-set -g set-titles on
-set -g set-titles-string "#T"
-
-# import
-if-shell "uname -s | grep -q Darwin" "source ~/.config/tmux/macos.conf"
-
-source ~/.config/tmux/theme.conf
-source ~/.config/tmux/statusline.conf
-source ~/.config/tmux/utility.conf
-
-set -g @plugin 'tmux-plugins/tpm'
-set -g @plugin 'tmux-plugins/tmux-pain-control'
-run '~/.config/tmux/plugins/tpm/tpm'
diff --git a/tmux/utility.conf b/tmux/utility.conf
deleted file mode 100644
index 1d63e94..0000000
--- a/tmux/utility.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# Display lazygit
-bind -r g display-popup -d '#{pane_current_path}' -w80% -h80% -E lazygit
-