@sebastienrousseau/dotfiles 0.2.500 → 0.2.502
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +154 -0
- package/README.md +113 -45
- package/docs/.vitepress/reports/localization-readability-audit.md +4 -0
- package/docs/AI.md +8 -2
- package/docs/CNAME +1 -0
- package/docs/COPYRIGHT +1 -1
- package/docs/NAMING_CONVENTIONS.md +7 -0
- package/docs/README.md +4 -0
- package/docs/_config.yml +59 -0
- package/docs/adr/ADR-001-ci-cd-pipeline.md +17 -0
- package/docs/adr/ADR-002-shell-performance.md +9 -0
- package/docs/adr/ADR-003-security-first.md +18 -0
- package/docs/adr/ADR-004-cli-architecture.md +14 -0
- package/docs/adr/ADR-005-chezmoi-choice.md +10 -0
- package/docs/adr/ADR-006-shell-selection.md +9 -0
- package/docs/adr/ADR-007-multi-shell-parity.md +10 -1
- package/docs/adr/ADR-008-alias-system-architecture.md +10 -0
- package/docs/adr/ADR-009-wallpaper-driven-theming.md +131 -0
- package/docs/adr/ADR-010-starship-transient-prompt.md +144 -0
- package/docs/adr/ADR-011-nushell-tier3-keep.md +144 -0
- package/docs/adr/README.md +7 -0
- package/docs/architecture/ARCHITECTURE.md +4 -0
- package/docs/architecture/INTEROP.md +8 -0
- package/docs/architecture/REPO_LAYOUT.md +5 -1
- package/docs/architecture/WALKTHROUGH.md +4 -0
- package/docs/architecture/fleet-deployment.md +4 -0
- package/docs/archive/EUXIS_2026_REVIEW.md +11 -3
- package/docs/archive/LEGACY_ROADMAP.md +45 -27
- package/docs/archive/MILESTONE_v0.2.493.md +4 -0
- package/docs/archive/PLAN.md +46 -8
- package/docs/archive/REPO_AUDIT.md +8 -0
- package/docs/guides/INSTALL.md +4 -0
- package/docs/guides/NEOVIM_IDE_GUIDE.md +9 -0
- package/docs/guides/THEMING.md +8 -0
- package/docs/guides/TROUBLESHOOTING.md +28 -0
- package/docs/guides/WSL2_NIX_TROUBLESHOOTING.md +70 -1
- package/docs/index.md +6 -2
- package/docs/interop/A2A.md +7 -0
- package/docs/interop/POWERSHELL.md +102 -0
- package/docs/manual/00-introduction.md +5 -1
- package/docs/manual/01-concepts/01-architecture.md +4 -0
- package/docs/manual/01-concepts/02-trust-model.md +6 -2
- package/docs/manual/01-concepts/03-theme-engine.md +4 -0
- package/docs/manual/01-concepts/04-fleet.md +7 -1
- package/docs/manual/01-concepts/05-self-healing.md +8 -1
- package/docs/manual/02-tutorials/01-first-install.md +5 -0
- package/docs/manual/02-tutorials/02-add-wallpaper.md +5 -0
- package/docs/manual/02-tutorials/03-create-profile.md +6 -0
- package/docs/manual/02-tutorials/04-encrypt-secret.md +6 -0
- package/docs/manual/02-tutorials/05-deploy-fleet.md +5 -1
- package/docs/manual/03-reference/01-dot-cli.md +67 -45
- package/docs/manual/03-reference/02-config-files.md +8 -2
- package/docs/manual/03-reference/03-environment.md +4 -0
- package/docs/manual/03-reference/04-templates.md +7 -1
- package/docs/manual/03-reference/05-feature-flags.md +72 -3
- package/docs/manual/04-cookbook/01-recipes.md +4 -0
- package/docs/manual/04-cookbook/02-troubleshooting.md +32 -0
- package/docs/manual/04-cookbook/03-faq.md +8 -0
- package/docs/manual/05-appendices/A-platform-matrix.md +4 -0
- package/docs/manual/05-appendices/B-security-checklist.md +6 -0
- package/docs/manual/05-appendices/C-glossary.md +4 -0
- package/docs/manual/05-appendices/D-bibliography.md +5 -1
- package/docs/manual/05-appendices/E-license.md +4 -0
- package/docs/manual/_toc.yml +1 -1
- package/docs/manual/command-index.md +16 -8
- package/docs/manual/concept-index.md +4 -0
- package/docs/manual/index.md +66 -0
- package/docs/operations/ATTESTATION.md +5 -0
- package/docs/operations/CI_CADENCE.md +107 -0
- package/docs/operations/CI_COMPOSITES.md +156 -0
- package/docs/operations/COMPLETIONS.md +123 -0
- package/docs/operations/COVERAGE.md +182 -0
- package/docs/operations/DRIFT.md +107 -0
- package/docs/operations/HARD_AUDIT_2026.md +631 -0
- package/docs/operations/MAINTENANCE.md +5 -1
- package/docs/operations/MIGRATION.md +14 -6
- package/docs/operations/OPERATIONS.md +24 -0
- package/docs/operations/PERFORMANCE.md +133 -0
- package/docs/operations/REGISTRY.md +89 -0
- package/docs/operations/RELIABILITY.md +6 -0
- package/docs/operations/ROADMAP.md +36 -18
- package/docs/operations/ROADMAP_2026.md +665 -0
- package/docs/operations/TESTING.md +4 -0
- package/docs/operations/TRACEABILITY.md +7 -0
- package/docs/operations/TRUSTED_AGENT_WORKSTATION.md +4 -0
- package/docs/operations/VERSION_SYNC.md +54 -5
- package/docs/reference/ALIASES.md +7 -0
- package/docs/reference/ALIASES_CHEATSHEET.md +5 -1
- package/docs/reference/ALIASES_DEPRECATIONS.md +5 -1
- package/docs/reference/FEATURES.md +4 -0
- package/docs/reference/FONTS.md +4 -0
- package/docs/reference/POWERSHELL_PARITY.md +80 -0
- package/docs/reference/PROFILES.md +4 -0
- package/docs/reference/SCREENSHOTS.md +4 -0
- package/docs/reference/SCRIPTS.md +4 -0
- package/docs/reference/SUPPORT_MATRIX.md +10 -4
- package/docs/reference/THEMES.md +4 -0
- package/docs/reference/TOOLS.md +4 -0
- package/docs/reference/UTILS.md +16 -12
- package/docs/registry.json +6 -0
- package/docs/security/AI_ACT_COMPLIANCE.md +4 -0
- package/docs/security/AUDIT_BYPASS.md +103 -0
- package/docs/security/AUTOMATION_SECRETS.md +4 -0
- package/docs/security/CI_EGRESS_ALLOWLIST.md +127 -0
- package/docs/security/CI_PINNING.md +113 -0
- package/docs/security/COMMIT_SIGNING.md +138 -0
- package/docs/security/COMPLIANCE.md +5 -0
- package/docs/security/DEPS_DEV_EXCEPTIONS.md +86 -0
- package/docs/security/DISCLOSURE.md +130 -0
- package/docs/security/ENCRYPTION.md +5 -0
- package/docs/security/FMEA.md +4 -0
- package/docs/security/HISTORY_FILTERING.md +132 -0
- package/docs/security/INCIDENT_RESPONSE.md +4 -0
- package/docs/security/INSTALL_VERIFICATION.md +122 -0
- package/docs/security/KEYS.md +4 -0
- package/docs/security/KEY_ROTATION.md +85 -1
- package/docs/security/MCP_POLICY.md +9 -0
- package/docs/security/POLICY_RELEASES.md +4 -0
- package/docs/security/README.md +4 -0
- package/docs/security/SCORECARD.md +140 -0
- package/docs/security/SECRETS.md +12 -0
- package/docs/security/SECURITY.md +4 -0
- package/docs/security/SECURITY_CHECKLIST.md +11 -0
- package/docs/security/SHELL_EXEMPTIONS.md +145 -0
- package/docs/security/SOUP_REGISTER.md +4 -0
- package/docs/security/THREAT_MODEL.md +10 -0
- package/docs/security/VERIFICATION_VALIDATION.md +5 -1
- package/docs/security/security-pubkey.asc +15 -0
- package/docs/themes/README.md +4 -0
- package/docs/themes/VISUAL_INTEGRITY_REPORT.md +4 -0
- package/dot_config/ai/identity.md +3 -0
- package/dot_config/ai/patterns/architect.md +2 -0
- package/dot_config/ai/patterns/hardener.md +2 -0
- package/dot_config/ai/patterns/refactor.md +2 -0
- package/dot_config/alacritty/alacritty.toml.tmpl +3 -3
- package/dot_config/atuin/config.toml.tmpl +47 -0
- package/dot_config/dotfiles/agent-card.json +1 -1
- package/dot_config/dotfiles/boot/README.md +2 -0
- package/dot_config/dotfiles/grub/README.md +2 -0
- package/dot_config/dotfiles/lock/README.md +2 -0
- package/dot_config/fish/conf.d/direnv.fish +4 -0
- package/dot_config/fish/conf.d/init.fish.tmpl +21 -0
- package/dot_config/fish/conf.d/mise-activate.fish +5 -0
- package/dot_config/fish/functions/_cached_eval.fish +84 -11
- package/dot_config/fish/functions/_cached_eval_clear.fish +17 -0
- package/dot_config/foot/foot.ini.tmpl +3 -3
- package/dot_config/fuzzel/fuzzel.ini.tmpl +2 -2
- package/dot_config/ghostty/config.tmpl +3 -3
- package/dot_config/git/hooks/executable_commit-msg +146 -0
- package/dot_config/goose/config.yaml +2 -2
- package/dot_config/gtk-3.0/gtk.css.tmpl +2 -2
- package/dot_config/gtk-3.0/settings.ini.tmpl +2 -2
- package/dot_config/gtk-4.0/gtk.css.tmpl +2 -2
- package/dot_config/gtk-4.0/settings.ini.tmpl +2 -2
- package/dot_config/kitty/kitty.conf.tmpl +3 -3
- package/dot_config/mise/config.toml +1 -1
- package/dot_config/niri/config.kdl.tmpl +2 -2
- package/dot_config/nushell/cached_eval.nu +80 -0
- package/dot_config/nushell/env.nu.tmpl +21 -13
- package/dot_config/shell/00-core-paths.sh.tmpl +9 -1
- package/dot_config/shell/05-core-safety.sh +1 -0
- package/dot_config/shell/10-secrets.sh +1 -0
- package/dot_config/shell/40-fzf-defaults.sh.tmpl +1 -0
- package/dot_config/shell/40-ls-colors.sh +1 -0
- package/dot_config/shell/50-logic-functions-core.sh.tmpl +1 -0
- package/dot_config/shell/50-logic-functions.sh.tmpl +1 -0
- package/dot_config/shell/51-logic-functions-extra.sh.tmpl +1 -0
- package/dot_config/shell/90-ux-aliases.sh.tmpl +1 -0
- package/dot_config/shell/91-ux-aliases-lazy.sh.tmpl +1 -0
- package/dot_config/shell/README.md +25 -8
- package/dot_config/starship.toml.tmpl +2 -2
- package/dot_config/tmux/tmux.conf.tmpl +3 -3
- package/dot_config/user-dirs.dirs +1 -0
- package/dot_config/vscode/settings.json.tmpl +2 -2
- package/dot_config/waybar/config.jsonc.tmpl +2 -2
- package/dot_config/waybar/style.css.tmpl +2 -2
- package/dot_config/wezterm/wezterm.lua.tmpl +3 -3
- package/dot_config/zsh/dot_zshrc.tmpl +207 -17
- package/dot_config/zsh/rc.d/00-alias-shims.zsh +28 -6
- package/dot_config/zsh/rc.d/30-options.zsh.tmpl +27 -7
- package/dot_local/bin/executable_bm +2 -0
- package/dot_local/bin/executable_dot +56 -9
- package/dot_local/bin/executable_dot-bootstrap +0 -1
- package/dot_local/bin/executable_dot-load-benchmark +1 -1
- package/dot_local/bin/executable_dot-theme-sync +8 -8
- package/dot_local/bin/executable_notify +2 -0
- package/dot_local/bin/executable_open +2 -0
- package/dot_local/bin/executable_tour +4 -2
- package/dot_local/bin/executable_up +3 -1
- package/dot_local/share/man/man1/dot.1 +1 -1
- package/dot_local/share/zsh/completions/_dot +4 -0
- package/install.sh +53 -38
- package/package.json +1 -1
- package/scripts/ci/check-dangerous-chmod.sh +19 -0
- package/scripts/ci/check-deps-dev.sh +236 -0
- package/scripts/ci/check-insecure-tls.sh +61 -0
- package/scripts/ci/check-regression-traceability.sh +67 -0
- package/scripts/ci/check-shell-preamble.sh +106 -0
- package/scripts/ci/dot-cli-startup-bench.sh +126 -0
- package/scripts/ci/install-chezmoi-verified.sh +4 -1
- package/scripts/ci/lint-reusable-pins.sh +78 -0
- package/scripts/ci/run-coverage.sh +451 -0
- package/scripts/ci/validate-chezmoidata.sh +25 -0
- package/scripts/ci/windows-smoke-test.ps1 +136 -0
- package/scripts/diagnostics/doctor.sh +203 -5
- package/scripts/diagnostics/drift-dashboard.sh +177 -13
- package/scripts/diagnostics/health.sh +21 -4
- package/scripts/diagnostics/perf.sh +304 -77
- package/scripts/diagnostics/workstation-attestation.sh +6 -1
- package/scripts/dot/commands/agent.sh +33 -27
- package/scripts/dot/commands/agents.sh +325 -0
- package/scripts/dot/commands/ai.sh +75 -10
- package/scripts/dot/commands/aliases.sh +10 -8
- package/scripts/dot/commands/core.sh +10 -4
- package/scripts/dot/commands/fleet.sh +278 -3
- package/scripts/dot/commands/init.sh +184 -0
- package/scripts/dot/commands/meta.sh +7 -4
- package/scripts/dot/commands/registry.sh +263 -0
- package/scripts/dot/commands/tools.sh +49 -1
- package/scripts/dot/lib/bento.sh +2 -1
- package/scripts/dot/lib/log.sh +6 -0
- package/scripts/dot/lib/platform.sh +22 -8
- package/scripts/dot/lib/ui.sh +145 -2
- package/scripts/dot/lib/utils.sh +6 -1
- package/scripts/git-hooks/pre-commit-audit.sh +1 -1
- package/scripts/git-hooks/pre-push +66 -3
- package/scripts/lib/secrets_provider.sh +32 -6
- package/scripts/ops/heal-chezmoi.sh +41 -6
- package/scripts/ops/rollback.sh +14 -0
- package/scripts/qa/powershell-contract.ps1 +95 -0
- package/scripts/security/check-disclosure-key-expiry.sh +110 -0
- package/scripts/security/lock-configs.sh +11 -2
- package/scripts/theme/merge-wallpaper.sh +4 -0
- package/scripts/theme/switch.sh +20 -10
- package/scripts/version-sync.sh +3 -0
- package/dot_config/atuin/config.toml +0 -40
- package/dot_local/bin/__pycache__/executable_dot-load-benchmark-ptycpython-312.pyc +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
+
# Sourced by dot_zshrc.tmpl / dot_bashrc / dot_config/fish/conf.d/; inherits set -euo pipefail from the caller.
|
|
2
3
|
## Construct PATH hierarchy for all language runtimes and tools.
|
|
3
4
|
##
|
|
4
5
|
## Sets PATH precedence: Local bin > Language runtimes > Homebrew > System.
|
|
@@ -40,7 +41,14 @@ path_prepend() {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
# 1. System Paths (Prepend, but will be pushed down by later prepends)
|
|
43
|
-
|
|
44
|
+
# Use path_prepend so existing entries are removed first — avoids the
|
|
45
|
+
# duplicate-system-path bloat that `PATH="...:${PATH}"` produces when
|
|
46
|
+
# the parent shell already had these (e.g. macOS launchd default PATH).
|
|
47
|
+
path_prepend "/sbin"
|
|
48
|
+
path_prepend "/usr/sbin"
|
|
49
|
+
path_prepend "/bin"
|
|
50
|
+
path_prepend "/usr/bin"
|
|
51
|
+
path_prepend "/usr/local/bin"
|
|
44
52
|
|
|
45
53
|
# 2. Homebrew Paths (Prepend -> Higher Priority)
|
|
46
54
|
path_prepend "/opt/homebrew/sbin"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Copyright (c) 2015-2026 Dotfiles. All rights reserved.
|
|
3
|
+
# Sourced by dot_zshrc.tmpl / dot_bashrc; inherits set -euo pipefail from the caller.
|
|
3
4
|
|
|
4
5
|
# 10-secrets.sh: Optional secret bucket auto-loader
|
|
5
6
|
# Loads configured secret buckets into the current shell via `dot env load`.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
+
# Sourced by dot_zshrc.tmpl / dot_bashrc / fish bridge; inherits set -euo pipefail from the caller.
|
|
2
3
|
## WARNING: Alias names must be unique across all alias source files in
|
|
3
4
|
## .chezmoitemplates/aliases/. Duplicates silently overwrite earlier
|
|
4
5
|
## definitions. Run the alias-conflict test to detect collisions.
|
|
@@ -7,13 +7,13 @@ Welcome to your universally compatible, high-performance dotfiles configuration,
|
|
|
7
7
|
- **Universal Support**: Works seamlessly on macOS, Linux (Ubuntu/Debian), and Windows (WSL).
|
|
8
8
|
- **Fast Startup**: Optimized with `zcompile` and lazy-loading. Benchmarks vary by machine; use `DOTFILES_FAST=1` for the quickest first prompt.
|
|
9
9
|
- **Modern Core**: Replaces legacy Unix tools with Rust-based alternatives:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
- `eza` (ls)
|
|
11
|
+
- `bat` (cat)
|
|
12
|
+
- `ripgrep` (grep)
|
|
13
|
+
- `zoxide` (cd)
|
|
14
|
+
- `atuin` (history)
|
|
15
|
+
- `yazi` (files)
|
|
16
|
+
- `zellij` (multiplexer)
|
|
17
17
|
- **Starship Prompt**: A fast, customizable, cross-shell prompt.
|
|
18
18
|
- **Optimized Vim**: Vim settings are kept minimal and fast by default.
|
|
19
19
|
- **Modular Design**: Configuration is split into small, manageable templates.
|
|
@@ -23,13 +23,15 @@ Welcome to your universally compatible, high-performance dotfiles configuration,
|
|
|
23
23
|
## Get started
|
|
24
24
|
|
|
25
25
|
### Install
|
|
26
|
+
|
|
26
27
|
To install these dotfiles on a new machine, run:
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
|
-
sh -c "$(curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/v0.2.
|
|
30
|
+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/sebastienrousseau/dotfiles/v0.2.502/install.sh)"
|
|
30
31
|
```
|
|
31
32
|
|
|
32
33
|
This command will:
|
|
34
|
+
|
|
33
35
|
1. Install `chezmoi`.
|
|
34
36
|
2. Clone this repository.
|
|
35
37
|
3. Install required packages (Homebrew/Apt).
|
|
@@ -40,7 +42,9 @@ This command will:
|
|
|
40
42
|
## Keep it current
|
|
41
43
|
|
|
42
44
|
### macOS
|
|
45
|
+
|
|
43
46
|
Updates are handled via [Homebrew](https://brew.sh/).
|
|
47
|
+
|
|
44
48
|
1. Edit `~/.dotfiles/dot_config/shell/Brewfile.cli` and `~/.dotfiles/dot_config/shell/Brewfile.cask`.
|
|
45
49
|
2. Run `chezmoi apply`.
|
|
46
50
|
- This triggers `run_onchange_darwin_install-packages.sh.tmpl`, which runs `brew bundle` for CLI and GUI packages.
|
|
@@ -48,16 +52,20 @@ Updates are handled via [Homebrew](https://brew.sh/).
|
|
|
48
52
|
- Optional: `duti` applies default app bindings from `~/.config/duti/defaults.duti`.
|
|
49
53
|
|
|
50
54
|
### VS Code extensions
|
|
55
|
+
|
|
51
56
|
1. Edit `~/.config/vscode/extensions.txt`.
|
|
52
57
|
2. Run `chezmoi apply` to install missing extensions (if `code` is available).
|
|
53
58
|
|
|
54
59
|
### Linux and WSL
|
|
60
|
+
|
|
55
61
|
Updates are handled via `apt-get` (Ubuntu/Debian).
|
|
62
|
+
|
|
56
63
|
1. Run `chezmoi apply`.
|
|
57
64
|
- This checks for package updates defined in `run_onchange_linux_install-packages.sh.tmpl`.
|
|
58
65
|
- Optional Flatpak list is read from `~/.config/flatpak/flatpak.list`.
|
|
59
66
|
|
|
60
67
|
### Vim plugins
|
|
68
|
+
|
|
61
69
|
1. Edit `~/.dotfiles/dot_vimrc`.
|
|
62
70
|
2. Run `chezmoi apply`.
|
|
63
71
|
- This automatically runs `vim +PlugInstall +PlugClean +qa`.
|
|
@@ -69,12 +77,14 @@ Updates are handled via `apt-get` (Ubuntu/Debian).
|
|
|
69
77
|
If you are migrating from an old `~/.dotfiles` setup:
|
|
70
78
|
|
|
71
79
|
1. **Backup**:
|
|
80
|
+
|
|
72
81
|
```bash
|
|
73
82
|
mv ~/.dotfiles ~/.dotfiles.legacy
|
|
74
83
|
cp ~/.zshrc ~/.zshrc.bak
|
|
75
84
|
```
|
|
76
85
|
|
|
77
86
|
2. **Initialize Chezmoi**:
|
|
87
|
+
|
|
78
88
|
```bash
|
|
79
89
|
git clone https://github.com/sebastienrousseau/dotfiles.git ~/.dotfiles
|
|
80
90
|
chezmoi apply
|
|
@@ -115,6 +125,7 @@ The configuration is managed in `~/.dotfiles`.
|
|
|
115
125
|
## Use it
|
|
116
126
|
|
|
117
127
|
### Apply changes
|
|
128
|
+
|
|
118
129
|
After editing any file in `~/.dotfiles`, apply the changes to your home directory:
|
|
119
130
|
|
|
120
131
|
```bash
|
|
@@ -195,6 +206,7 @@ ${EDITOR:-nano} ~/.config/chezmoi/chezmoi.toml
|
|
|
195
206
|
```
|
|
196
207
|
|
|
197
208
|
Fields:
|
|
209
|
+
|
|
198
210
|
- `git_name`
|
|
199
211
|
- `git_email`
|
|
200
212
|
- `git_signingkey`
|
|
@@ -211,6 +223,7 @@ terminal_font_size = 12
|
|
|
211
223
|
```
|
|
212
224
|
|
|
213
225
|
Available themes:
|
|
226
|
+
|
|
214
227
|
- `tokyonight-night` (best dark default)
|
|
215
228
|
- `tokyonight-day` (best light default)
|
|
216
229
|
- `tokyonight-storm`
|
|
@@ -242,6 +255,7 @@ Available themes:
|
|
|
242
255
|
```
|
|
243
256
|
|
|
244
257
|
### Add aliases
|
|
258
|
+
|
|
245
259
|
1. Navigate to `~/.dotfiles/.chezmoitemplates/aliases/`.
|
|
246
260
|
2. Create a new file (e.g., `mytool/mytool.aliases.sh`) or edit an existing one.
|
|
247
261
|
3. Add your aliases.
|
|
@@ -250,12 +264,14 @@ Available themes:
|
|
|
250
264
|
**Note:** Files in `macOS/` are only included on macOS systems.
|
|
251
265
|
|
|
252
266
|
### Add functions
|
|
267
|
+
|
|
253
268
|
1. Navigate to `~/.dotfiles/.chezmoitemplates/functions/`.
|
|
254
269
|
2. Create a new `.sh` file.
|
|
255
270
|
3. Define your function with a usage comment.
|
|
256
271
|
4. Run `chezmoi apply`.
|
|
257
272
|
|
|
258
273
|
## Performance
|
|
274
|
+
|
|
259
275
|
- **Lazy Loading**: Heavy tools (like `nvm`, `rbenv`) are lazy-loaded. They only initialize when you type the command.
|
|
260
276
|
- **Zcompile**: Your `.zshrc` and generated config files are automatically compiled to `.zwc` bytecode for faster parsing.
|
|
261
277
|
- **Fast Mode**: Set `DOTFILES_FAST=1` to skip heavy startup work (plugins, completions, prompt tooling, AI helpers) for the quickest possible first prompt.
|
|
@@ -264,4 +280,5 @@ Available themes:
|
|
|
264
280
|
- **Deferred Hooks**: Use `DOTFILES_DEFER_COMPINIT=1`, `DOTFILES_DEFER_TOOLS=1`, and `DOTFILES_DEFER_ZINIT_MODE=preexec` to move work after the first command.
|
|
265
281
|
|
|
266
282
|
## Test
|
|
283
|
+
|
|
267
284
|
This repository includes GitHub Actions CI to test the configuration on macOS, Ubuntu, and Windows for every Pull Request.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
# Raise timeout to avoid spurious prompt warnings.
|
|
6
6
|
command_timeout = 5000
|
|
7
7
|
add_newline = true
|
|
8
|
-
{{- $t := index .themes (default "
|
|
9
|
-
{{- if not $t -}}{{- $t = index .themes "
|
|
8
|
+
{{- $t := index .themes (default "big-sur-dark" .theme) -}}
|
|
9
|
+
{{- if not $t -}}{{- $t = index .themes "big-sur-dark" -}}{{- end }}
|
|
10
10
|
# Palette driven by starship_palette in .chezmoidata/themes.toml
|
|
11
11
|
palette = "{{ $t.app.starship_palette }}"
|
|
12
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{{- $t := index .themes (default "
|
|
2
|
-
{{- if not $t -}}{{- $t = index .themes "
|
|
1
|
+
{{- $t := index .themes (default "big-sur-dark" .theme) -}}
|
|
2
|
+
{{- if not $t -}}{{- $t = index .themes "big-sur-dark" -}}{{- end -}}
|
|
3
3
|
{{- $bg := $t.term.bg -}}
|
|
4
4
|
{{- $fg := $t.term.fg -}}
|
|
5
5
|
{{- $accent := $t.ui.accent -}}
|
|
@@ -141,7 +141,7 @@ bind K confirm-before -p "kill all sessions? (y/n)" kill-server
|
|
|
141
141
|
|
|
142
142
|
# ╔══════════════════════════════════════════════════════════════════════════╗
|
|
143
143
|
# ║ THEME — Powerline Status Bar ║
|
|
144
|
-
# ║ Colors from .chezmoidata/themes.toml ({{ default "
|
|
144
|
+
# ║ Colors from .chezmoidata/themes.toml ({{ default "big-sur-dark" .theme }}) ║
|
|
145
145
|
# ╚══════════════════════════════════════════════════════════════════════════╝
|
|
146
146
|
|
|
147
147
|
# --- Status Bar ---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
// Theme Configuration - Dynamically set based on chezmoi theme variable
|
|
3
|
-
{{- $t := index .themes (default "
|
|
4
|
-
{{- if not $t -}}{{- $t = index .themes "
|
|
3
|
+
{{- $t := index .themes (default "big-sur-dark" .theme) -}}
|
|
4
|
+
{{- if not $t -}}{{- $t = index .themes "big-sur-dark" -}}{{- end }}
|
|
5
5
|
"workbench.colorTheme": "{{ $t.app.vscode }}",
|
|
6
6
|
"workbench.preferredDarkColorTheme": "{{ $t.app.vscode_dark }}",
|
|
7
7
|
"workbench.preferredLightColorTheme": "{{ $t.app.vscode_light }}",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{{- $t := index .themes (default "
|
|
2
|
-
{{- if not $t -}}{{- $t = index .themes "
|
|
1
|
+
{{- $t := index .themes (default "big-sur-dark" .theme) -}}
|
|
2
|
+
{{- if not $t -}}{{- $t = index .themes "big-sur-dark" -}}{{- end -}}
|
|
3
3
|
{{- /* Copyright (c) 2015-2026 Dotfiles. All rights reserved. */ -}}
|
|
4
4
|
// Waybar configuration for niri — {{ .theme }}
|
|
5
5
|
// Generated by chezmoi · dotfiles v{{ .dotfiles_version }}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{{- $t := index .themes (default "
|
|
2
|
-
{{- if not $t -}}{{- $t = index .themes "
|
|
1
|
+
{{- $t := index .themes (default "big-sur-dark" .theme) -}}
|
|
2
|
+
{{- if not $t -}}{{- $t = index .themes "big-sur-dark" -}}{{- end -}}
|
|
3
3
|
{{- /* Copyright (c) 2015-2026 Dotfiles. All rights reserved. */ -}}
|
|
4
4
|
{{- $bg := $t.term.bg -}}
|
|
5
5
|
{{- $fg := $t.term.fg -}}
|
|
@@ -7,10 +7,10 @@ end
|
|
|
7
7
|
|
|
8
8
|
{{- $fontFamily := default "JetBrainsMono Nerd Font" .terminal_font_family -}}
|
|
9
9
|
{{- $fontSize := default 12 .terminal_font_size -}}
|
|
10
|
-
{{- $t := index .themes (default "
|
|
11
|
-
{{- if not $t -}}{{- $t = index .themes "
|
|
10
|
+
{{- $t := index .themes (default "big-sur-dark" .theme) -}}
|
|
11
|
+
{{- if not $t -}}{{- $t = index .themes "big-sur-dark" -}}{{- end }}
|
|
12
12
|
{{- $tt := $t -}}
|
|
13
|
-
{{- $themeName := default "
|
|
13
|
+
{{- $themeName := default "big-sur-dark" .theme -}}
|
|
14
14
|
{{- if hasSuffix "-light" $themeName -}}
|
|
15
15
|
{{- $darkTheme := index .themes (printf "%s-dark" (trimSuffix "-light" $themeName)) -}}
|
|
16
16
|
{{- if $darkTheme -}}{{- $tt = $darkTheme -}}{{- end -}}
|
|
@@ -28,7 +28,7 @@ export FORCE_COLOR_OS="Windows"
|
|
|
28
28
|
|
|
29
29
|
{{- $profile := default "laptop" .profile -}}
|
|
30
30
|
{{- $features := default (dict "zsh" true "nvim" true "tmux" true "gui" true "secrets" true) .features -}}
|
|
31
|
-
{{- $theme := default "
|
|
31
|
+
{{- $theme := default "big-sur-dark" .theme -}}
|
|
32
32
|
{{- $strict_mode := default false (index . "strict_mode") -}}
|
|
33
33
|
{{- $enabled := list -}}
|
|
34
34
|
{{- range $k, $v := $features }}{{- if $v }}{{- $enabled = append $enabled $k }}{{- end }}{{- end }}
|
|
@@ -108,27 +108,189 @@ fi
|
|
|
108
108
|
_SHELL_CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh"
|
|
109
109
|
[[ -d "$_SHELL_CACHE" ]] || mkdir -p "$_SHELL_CACHE"
|
|
110
110
|
|
|
111
|
+
# Append a timing event to ${XDG_STATE_HOME:-~/.local/state}/dotfiles/eval-timings.jsonl.
|
|
112
|
+
# Read by `dot perf --by-tool` to attribute startup time per tool.
|
|
113
|
+
_cached_eval_log_timing() {
|
|
114
|
+
emulate -L zsh
|
|
115
|
+
setopt no_clobber 2>/dev/null && unsetopt no_clobber
|
|
116
|
+
local label="$1" t0="$2" t1="$3" rc="${4:-0}" shell="${5:-zsh}"
|
|
117
|
+
local log_dir="${XDG_STATE_HOME:-$HOME/.local/state}/dotfiles"
|
|
118
|
+
[[ -d "$log_dir" ]] || mkdir -p "$log_dir" 2>/dev/null || return 0
|
|
119
|
+
local logfile="$log_dir/eval-timings.jsonl"
|
|
120
|
+
[[ -f "$logfile" ]] || touch "$logfile" 2>/dev/null || return 0
|
|
121
|
+
local ms_int=0
|
|
122
|
+
if [[ -n "$t0" && -n "$t1" ]]; then
|
|
123
|
+
ms_int=$(printf '%.0f' "$(( (t1 - t0) * 1000 ))" 2>/dev/null) || ms_int=0
|
|
124
|
+
fi
|
|
125
|
+
printf '{"ts":"%s","shell":"%s","label":"%s","ms":%s,"rc":%s}\n' \
|
|
126
|
+
"$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$shell" "$label" "$ms_int" "$rc" \
|
|
127
|
+
>> "$logfile" 2>/dev/null || true
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Cache and source a tool's init output, with mtime/realpath/file-arg invalidation.
|
|
131
|
+
#
|
|
132
|
+
# Runs <cmd args...> on cache miss, vets the output for shell-injection
|
|
133
|
+
# patterns, writes atomically, sources, and precompiles via zcompile in
|
|
134
|
+
# the background. Cache invalidates when the binary's mtime is newer,
|
|
135
|
+
# its realpath has changed (PATH-shadow swap), or a file-path argument
|
|
136
|
+
# is newer than the cache.
|
|
137
|
+
#
|
|
138
|
+
# @arg $1 string Cache label (cache file: $_SHELL_CACHE/<label>.zsh)
|
|
139
|
+
# @arg $2..N string Command and args to run on cache miss
|
|
140
|
+
# @env EVALCACHE_DISABLE Set to "true" to bypass cache read AND write
|
|
141
|
+
# @env EVALCACHE_TIMING Set to "1" to log per-call timing for `dot perf --by-tool`
|
|
142
|
+
# @stdout Sourced cache content
|
|
143
|
+
# @stderr Warning on init failure or suspicious-output rejection
|
|
144
|
+
# @exitcode 0 Cache hit, successful regeneration, or successful bypass
|
|
145
|
+
# @exitcode 1 Suspicious pattern detected in init output
|
|
146
|
+
# @exitcode * Init command's exit code on non-zero return
|
|
111
147
|
_cached_eval() {
|
|
148
|
+
if [[ "$EVALCACHE_TIMING" != "1" ]]; then
|
|
149
|
+
_cached_eval_impl "$@"
|
|
150
|
+
return
|
|
151
|
+
fi
|
|
152
|
+
zmodload zsh/datetime 2>/dev/null
|
|
153
|
+
local _ce_t0="${EPOCHREALTIME:-$(date +%s.%N 2>/dev/null || echo 0)}"
|
|
154
|
+
_cached_eval_impl "$@"
|
|
155
|
+
local _ce_rc=$?
|
|
156
|
+
local _ce_t1="${EPOCHREALTIME:-$(date +%s.%N 2>/dev/null || echo 0)}"
|
|
157
|
+
_cached_eval_log_timing "${1:-unknown}" "$_ce_t0" "$_ce_t1" "$_ce_rc" "zsh"
|
|
158
|
+
return $_ce_rc
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
_cached_eval_impl() {
|
|
112
162
|
local label=$1; shift
|
|
163
|
+
|
|
164
|
+
# Debug bypass: skip cache read AND write entirely.
|
|
165
|
+
# Set EVALCACHE_DISABLE=true to eval directly without touching cache files.
|
|
166
|
+
if [[ "$EVALCACHE_DISABLE" == "true" ]]; then
|
|
167
|
+
eval "$("$@" 2>/dev/null)"
|
|
168
|
+
return $?
|
|
169
|
+
fi
|
|
170
|
+
|
|
113
171
|
local cache="$_SHELL_CACHE/${label}.zsh"
|
|
172
|
+
local pin="${cache}.bin"
|
|
114
173
|
local bin="${commands[$1]}"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
174
|
+
local real_bin=""
|
|
175
|
+
[[ -n "$bin" ]] && real_bin=${bin:A}
|
|
176
|
+
|
|
177
|
+
# Cache is valid when: it exists non-empty, the binary is not newer than it,
|
|
178
|
+
# the recorded realpath (if any) still matches the current realpath, and no
|
|
179
|
+
# file-path argument has been modified since cache write.
|
|
180
|
+
local cache_valid=1
|
|
181
|
+
if [[ ! -s "$cache" ]]; then
|
|
182
|
+
cache_valid=0
|
|
183
|
+
elif [[ -n "$bin" && "$bin" -nt "$cache" ]]; then
|
|
184
|
+
cache_valid=0
|
|
185
|
+
elif [[ -f "$pin" && -n "$real_bin" ]]; then
|
|
186
|
+
local pinned_real
|
|
187
|
+
pinned_real=$(<"$pin")
|
|
188
|
+
[[ -n "$pinned_real" && "$pinned_real" != "$real_bin" ]] && cache_valid=0
|
|
189
|
+
fi
|
|
190
|
+
if (( cache_valid )); then
|
|
191
|
+
local arg
|
|
192
|
+
for arg in "${@:2}"; do
|
|
193
|
+
if [[ -f "$arg" && "$arg" -nt "$cache" ]]; then
|
|
194
|
+
cache_valid=0
|
|
195
|
+
break
|
|
196
|
+
fi
|
|
197
|
+
done
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
if (( cache_valid )); then
|
|
129
201
|
source "$cache"
|
|
130
|
-
|
|
202
|
+
return
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
local init_output rc
|
|
206
|
+
init_output=$("$@" 2>/dev/null)
|
|
207
|
+
rc=$?
|
|
208
|
+
if (( rc != 0 )); then
|
|
209
|
+
print -u2 "[WARN] $label init exited $rc; not caching"
|
|
210
|
+
return $rc
|
|
131
211
|
fi
|
|
212
|
+
|
|
213
|
+
# Reject suspicious patterns indicating malicious payloads
|
|
214
|
+
local suspicious_re='(curl[[:space:]].*\|[[:space:]]*(ba)?sh|wget[[:space:]].*\|[[:space:]]*(ba)?sh|nc[[:space:]]+-e|/dev/tcp/|base64[[:space:]]+-d[[:space:]]*\|)'
|
|
215
|
+
if printf '%s\n' "$init_output" | LC_ALL=C grep -Eqs -- "$suspicious_re"; then
|
|
216
|
+
print -u2 "[WARN] Suspicious output from $label init, skipping"
|
|
217
|
+
return 1
|
|
218
|
+
fi
|
|
219
|
+
|
|
220
|
+
# `mktemp` instead of `${cache}.tmp.$$` — under PID recycling (very
|
|
221
|
+
# rare but possible) two concurrent shells with the same $$ could
|
|
222
|
+
# otherwise race on the same temp file. mktemp gives a unique name.
|
|
223
|
+
# Use `>|` so we overwrite the just-created mktemp file even when the
|
|
224
|
+
# user has `setopt noclobber` (see dot_config/shell/05-core-safety.sh).
|
|
225
|
+
local _tmp _tmp_pin
|
|
226
|
+
_tmp="$(mktemp "${cache}.XXXXXX")" || return 1
|
|
227
|
+
print -r -- "$init_output" >| "$_tmp" && mv "$_tmp" "$cache" || { rm -f "$_tmp"; return 1; }
|
|
228
|
+
if [[ -n "$real_bin" ]]; then
|
|
229
|
+
_tmp_pin="$(mktemp "${pin}.XXXXXX")" || return 1
|
|
230
|
+
print -r -- "$real_bin" >| "$_tmp_pin" && mv "$_tmp_pin" "$pin" || { rm -f "$_tmp_pin"; return 1; }
|
|
231
|
+
fi
|
|
232
|
+
source "$cache"
|
|
233
|
+
{ zcompile "$cache" } &!
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
# Clear cache files written by _cached_eval.
|
|
237
|
+
#
|
|
238
|
+
# Safe by design: only deletes *.zsh / *.zsh.bin / *.zwc files in
|
|
239
|
+
# $_SHELL_CACHE, leaving any unrelated content untouched.
|
|
240
|
+
#
|
|
241
|
+
# @noargs
|
|
242
|
+
# @stdout Single-line summary: "Cleared N cached eval file(s) from <dir>"
|
|
243
|
+
# @exitcode 0 Always (no-op when cache dir doesn't exist)
|
|
244
|
+
_cached_eval_clear() {
|
|
245
|
+
local cache_dir="$_SHELL_CACHE"
|
|
246
|
+
[[ -d "$cache_dir" ]] || return 0
|
|
247
|
+
local count=0 f
|
|
248
|
+
for f in "$cache_dir"/*.zsh(N) "$cache_dir"/*.zsh.bin(N) "$cache_dir"/*.zwc(N); do
|
|
249
|
+
rm -f -- "$f" && (( count++ ))
|
|
250
|
+
done
|
|
251
|
+
printf 'Cleared %d cached eval file(s) from %s\n' "$count" "$cache_dir"
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
# Lazy-load helper for user-supplied slow tools.
|
|
255
|
+
#
|
|
256
|
+
# Usage in ~/.config/zsh/rc.d/99-local.zsh:
|
|
257
|
+
# _dot_lazy nvm nvm node npm npx # nvm.sh sourced on first nvm/node/npm/npx call
|
|
258
|
+
# _dot_lazy pyenv pyenv python python3 pip pip3
|
|
259
|
+
# _dot_lazy conda conda
|
|
260
|
+
#
|
|
261
|
+
# First arg is the "trigger" — also the function name that bootstraps
|
|
262
|
+
# the real tool. Remaining args are the commands that, when invoked,
|
|
263
|
+
# bootstrap the trigger then re-exec the command. Bootstrap functions
|
|
264
|
+
# must export `_DOT_LAZY_<TRIGGER>_LOADED` so subsequent calls bypass
|
|
265
|
+
# the stub.
|
|
266
|
+
#
|
|
267
|
+
# Why this matters: every `eval "$(slowtool init zsh)"` at startup
|
|
268
|
+
# costs 50-200ms; lazy-load defers that to first use, keeping
|
|
269
|
+
# `dot version` cold-start under 100ms.
|
|
270
|
+
_dot_lazy() {
|
|
271
|
+
local trigger="$1"; shift || return 1
|
|
272
|
+
local cmd
|
|
273
|
+
for cmd in "$trigger" "$@"; do
|
|
274
|
+
# shellcheck disable=SC2139,SC2140
|
|
275
|
+
eval "$cmd() {
|
|
276
|
+
local _trigger=\"$trigger\"
|
|
277
|
+
local _loaded_var=\"_DOT_LAZY_\${(U)_trigger//[^A-Z0-9]/_}_LOADED\"
|
|
278
|
+
if [[ -z \${(P)_loaded_var} ]]; then
|
|
279
|
+
# Unset every stub so the real binary takes over.
|
|
280
|
+
local _c
|
|
281
|
+
for _c in \"$trigger\" $@; do
|
|
282
|
+
unset -f -- \"\$_c\" 2>/dev/null
|
|
283
|
+
done
|
|
284
|
+
# User must define a __dot_lazy_init_<trigger> bootstrap.
|
|
285
|
+
local _init=\"__dot_lazy_init_\${_trigger//-/_}\"
|
|
286
|
+
if (( \${+functions[\$_init]} )); then
|
|
287
|
+
\"\$_init\" || return \$?
|
|
288
|
+
fi
|
|
289
|
+
export \"\$_loaded_var=1\"
|
|
290
|
+
fi
|
|
291
|
+
command \"$cmd\" \"\$@\"
|
|
292
|
+
}"
|
|
293
|
+
done
|
|
132
294
|
}
|
|
133
295
|
|
|
134
296
|
# Lightweight precmd hook manager (faster than add-zsh-hook)
|
|
@@ -259,6 +421,23 @@ unset _core_layers
|
|
|
259
421
|
# Starship prompt (eager — must survive cache clears for consistent UI)
|
|
260
422
|
if [[ "$DOTFILES_ARTIFACT_MODE" != "1" ]] && (( ${+commands[starship]} )); then
|
|
261
423
|
_cached_eval starship-init starship init zsh
|
|
424
|
+
# Transient Prompt: collapse the prompt of past commands to the
|
|
425
|
+
# [character] glyph after Enter, reducing scrollback noise.
|
|
426
|
+
#
|
|
427
|
+
# Forward-compatibility hook. Starship's `enable_transience` function
|
|
428
|
+
# is currently defined only by `starship init fish` (upstream issue
|
|
429
|
+
# starship/starship#3522 tracks the zsh equivalent). On zsh the
|
|
430
|
+
# `${+functions[enable_transience]}` guard evaluates to 0, so the
|
|
431
|
+
# block silently no-ops. When upstream ships the zsh-side function,
|
|
432
|
+
# this code activates automatically — no zshrc change needed.
|
|
433
|
+
#
|
|
434
|
+
# The `_DOTFILES_STARSHIP_TRANSIENT` flag prevents the lazy-hydration
|
|
435
|
+
# path below (which also re-runs starship init) from binding the
|
|
436
|
+
# widgets twice.
|
|
437
|
+
if [[ -z "${_DOTFILES_STARSHIP_TRANSIENT:-}" ]] && (( ${+functions[enable_transience]} )); then
|
|
438
|
+
enable_transience
|
|
439
|
+
_DOTFILES_STARSHIP_TRANSIENT=1
|
|
440
|
+
fi
|
|
262
441
|
fi
|
|
263
442
|
|
|
264
443
|
# User-local modules (aliases, functions — not managed by chezmoi)
|
|
@@ -458,7 +637,13 @@ _dotfiles_async_init() {
|
|
|
458
637
|
_cached_eval atuin-init atuin init zsh
|
|
459
638
|
;;
|
|
460
639
|
starship)
|
|
461
|
-
[[ "$DOTFILES_ARTIFACT_MODE" == "0" ]]
|
|
640
|
+
if [[ "$DOTFILES_ARTIFACT_MODE" == "0" ]]; then
|
|
641
|
+
_cached_eval starship-init starship init zsh
|
|
642
|
+
if [[ -z "${_DOTFILES_STARSHIP_TRANSIENT:-}" ]] && (( ${+functions[enable_transience]} )); then
|
|
643
|
+
enable_transience
|
|
644
|
+
_DOTFILES_STARSHIP_TRANSIENT=1
|
|
645
|
+
fi
|
|
646
|
+
fi
|
|
462
647
|
;;
|
|
463
648
|
zoxide)
|
|
464
649
|
_cached_eval zoxide-init zoxide init zsh
|
|
@@ -466,6 +651,11 @@ _dotfiles_async_init() {
|
|
|
466
651
|
esac
|
|
467
652
|
fi
|
|
468
653
|
done
|
|
654
|
+
# mise/atuin/etc emit `export PATH=...` which bypasses zsh's -U flag on
|
|
655
|
+
# the `path` array — re-apply uniqueness to drop any duplicates baked
|
|
656
|
+
# into the cached output (e.g. system paths inherited from a dirty
|
|
657
|
+
# parent shell).
|
|
658
|
+
typeset -U path
|
|
469
659
|
}
|
|
470
660
|
|
|
471
661
|
# Deferred Hydration for Zero-Jank Experience
|
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
# shellcheck shell=bash
|
|
2
2
|
# Cognitive Shell Enhancements
|
|
3
|
+
#
|
|
4
|
+
# Carapace is deferred to first `preexec` (closes #862). The eager
|
|
5
|
+
# `_cached_eval carapace ...` call previously cost ~15ms on every
|
|
6
|
+
# interactive shell start even with the cache warm — that work is
|
|
7
|
+
# only needed when the user invokes tab-completion, which happens
|
|
8
|
+
# after the first command at the earliest. Opt out by setting
|
|
9
|
+
# `DOTFILES_DEFER_CARAPACE=0` (rarely useful).
|
|
3
10
|
if [[ -o interactive ]]; then
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
: ${DOTFILES_DEFER_CARAPACE:=1}
|
|
12
|
+
|
|
13
|
+
_dotfiles_carapace_init() {
|
|
14
|
+
if command -v carapace >/dev/null 2>&1; then
|
|
15
|
+
if typeset -f _cached_eval >/dev/null 2>&1; then
|
|
16
|
+
_cached_eval carapace carapace _carapace zsh
|
|
17
|
+
else
|
|
18
|
+
source <(carapace _zsh)
|
|
19
|
+
fi
|
|
10
20
|
fi
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if [[ "${DOTFILES_DEFER_CARAPACE}" == "1" ]] && typeset -f _dotfiles_add_preexec >/dev/null 2>&1; then
|
|
24
|
+
_dotfiles_carapace_deferred() {
|
|
25
|
+
_dotfiles_del_preexec _dotfiles_carapace_deferred
|
|
26
|
+
_dotfiles_carapace_init
|
|
27
|
+
}
|
|
28
|
+
_dotfiles_add_preexec _dotfiles_carapace_deferred
|
|
29
|
+
else
|
|
30
|
+
# Fallback to eager init when preexec helpers aren't available
|
|
31
|
+
# (e.g., DOTFILES_FAST=1 paths that skip the zshrc helper block).
|
|
32
|
+
_dotfiles_carapace_init
|
|
11
33
|
fi
|
|
12
34
|
|
|
13
35
|
# thefuck — lazy-loaded to avoid ~200ms startup penalty
|