Compare commits

...

4 Commits

Author SHA1 Message Date
rootiest e30fc7a15c docs(config-vars): cross-reference minimal mode from Section 1 Other 2026-06-10 11:41:04 -04:00
rootiest 7bd080769e docs(guards): document opinionated component toggles
Adds 'Opinionated Components (Minimal Mode)' to docs/fish-config.md
with index keywords (opinionated, minimal, minimal-mode, opt-out,
toggles) and a Minimal Mode section with toggle table to README.md.
AGENTS.md Task #3 checklist ticked locally (file is git-ignored).
2026-06-10 11:38:14 -04:00
rootiest dc97892a29 feat(guards): add in-function opinionated guards and CachyOS cleanup
C1 shadows (rm, cat, ls, less, du, bash, top, ping, ssh, rg, mkdir,
help) fall back to the bare command when __fish_config_op_aliases is
falsy; rm falls back to exact 'command rm' with no wrapper. C2 gates
the auto-venv PWD hook. C3 gates smart_exit (composing with Task #4
logging), fish_right_prompt, and all six expand_bang_*/expand_typo_sub
functions atomically with the bang-bang system. C4 integration commands
(spwin, tab, split, hist, logs, upgrade) refuse with a colored stderr
error when disabled. config.fish now also strips the CachyOS distro
config's own bang-bang bindings, history override, and alias opinions
per category, restoring fish stock functions where they exist.
2026-06-10 11:34:56 -04:00
rootiest ce84db593c feat(guards): add opinionated component guards to config.fish and conf.d
Adds __fish_config_op_enabled helper (master __fish_config_opinionated
evaluated first via __fish_variable_check, then the category variable)
and gates C1-C4 components: CachyOS surgical override, PAGER/MANPAGER,
CDPATH, Vi mode, exit override, bang-bang bindings, history/cp/mv/wget/
grep aliases, cd->z alias, Fisher bootstrap and theme apply, paru/yay
wrapper generation, WakaTime hook, custom key chords, puffer, autopair,
starship prompt, Catppuccin colors, FZF_DEFAULT_OPTS, done notifications,
and Kitty/WezTerm window-management abbreviations.
2026-06-10 11:28:43 -04:00
45 changed files with 664 additions and 235 deletions
+31
View File
@@ -11,6 +11,7 @@ abbreviation system for keyboard-driven workflows.
- [Documentation](#documentation)
- [Installation](#installation)
- [Personalization](#personalization)
- [Minimal Mode](#minimal-mode)
- [Attribution](#attribution)
- [License](#license)
@@ -28,6 +29,7 @@ This config layers on top of the CachyOS base Fish configuration and adds:
- **Kitty terminal** deep integration for splits, tabs, and SSH
- **AI workflow** helpers for Claude and Antigravity session management
- **WakaTime** shell activity tracking
- **Opt-out toggles** for every opinionated component — see [Minimal Mode](#minimal-mode)
---
@@ -162,6 +164,35 @@ end
---
## Minimal Mode
Everything opinionated in this config — command shadows, startup side-effects, key and environment overrides, and terminal integrations — is active by default but can be switched off with universal variables. Four category toggles and one master switch are available:
| Variable | Disables |
|---|---|
| `__fish_config_op_aliases` | Command shadows: `ls`→eza, `cat`→bat, `cd`→zoxide, `rm`→trash, `top`→btop, and friends; `grep`/`cp`/`mv`/`wget` flag injection |
| `__fish_config_op_autoexec` | Startup side-effects: Fisher bootstrap, theme apply, `paru`/`yay` wrapper generation, auto venv activation, WakaTime hook |
| `__fish_config_op_overrides` | Vi mode, `exit``smart_exit`, `$PAGER`/`$MANPAGER`/`$CDPATH`, bang-bang history expansion, autopair, puffer, Starship prompt, theme colors |
| `__fish_config_op_integrations` | Kitty/WezTerm window abbreviations, `done` notifications, `spwin`/`tab`/`split`, `hist`, `logs`, `upgrade`, WakaTime |
| `__fish_config_opinionated` | Master switch — all four categories at once |
Set any of them to a falsy value (`0`, `false`, `no`, `off`, `n`) to disable; erase the variable to re-enable:
```fish
# Plain shell: disable everything opinionated
set -U __fish_config_opinionated 0
# Or pick a single category, e.g. keep integrations but drop command shadows
set -U __fish_config_op_aliases off
# Back to full flavor
set -Ue __fish_config_opinionated
```
Command shadows react immediately; bindings, prompt, and abbreviations take effect in new shells. With aliases disabled, `rm` deletes permanently again instead of trashing. See `help config opinionated` for the full component list.
---
## Attribution
The core of the [Zoxide integration](docs/wiki/2-path-setup.md) in this repository was originally adapted from the [icezyclon/zoxide.fish](https://github.com/icezyclon/zoxide.fish) plugin (MIT Licensed) and has since been heavily customized for performance and Fish 4.x compatibility.
+191 -180
View File
@@ -76,13 +76,16 @@ abbr -a ag antigravity
abbr -a ag. antigravity .
# Quit
abbr -a /exit exit
if test "$TERM" = xterm-kitty
abbr -a :q kitty @ close-window # Kitty (Closes the active split/pane)
abbr -a :Q kitty @ close-tab # Kitty (Closes the whole tab)
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :q wezterm cli kill-pane # WezTerm
abbr -a :Q wezterm cli kill-pane # WezTerm
# Window-management abbreviations are opinionated (C4 integrations)
if __fish_config_op_enabled __fish_config_op_integrations
if test "$TERM" = xterm-kitty
abbr -a :q kitty @ close-window # Kitty (Closes the active split/pane)
abbr -a :Q kitty @ close-tab # Kitty (Closes the whole tab)
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :q wezterm cli kill-pane # WezTerm
abbr -a :Q wezterm cli kill-pane # WezTerm
end
end
######### Alternates ##########
@@ -103,184 +106,188 @@ abbr -a lsT lstree
# Speedtest using fast.com
abbr -a speedtest-fast fast-cli
# Window Creation (OS Windows)
if test "$TERM" = xterm-kitty
abbr -a :w kitty @ launch --type=os-window # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :w wezterm cli spawn --new-window # WezTerm
end
# Kitty/WezTerm window-management abbreviations are opinionated (C4
# integrations): they assume an active Kitty or WezTerm session.
if __fish_config_op_enabled __fish_config_op_integrations
# Window Creation (OS Windows)
if test "$TERM" = xterm-kitty
abbr -a :w kitty @ launch --type=os-window # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :w wezterm cli spawn --new-window # WezTerm
end
# Window Splits (Panes)
if test "$TERM" = xterm-kitty
abbr -a :wv kitty @ launch --location=hsplit # Kitty (Horizontal split)
abbr -a :wh kitty @ launch --location=vsplit # Kitty (Vertical split)
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wv wezterm cli split-pane --bottom # WezTerm
abbr -a :wh wezterm cli split-pane --right # WezTerm
end
# Window Splits (Panes)
if test "$TERM" = xterm-kitty
abbr -a :wv kitty @ launch --location=hsplit # Kitty (Horizontal split)
abbr -a :wh kitty @ launch --location=vsplit # Kitty (Vertical split)
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wv wezterm cli split-pane --bottom # WezTerm
abbr -a :wh wezterm cli split-pane --right # WezTerm
end
# Window Detach (Move Pane)
if test "$TERM" = xterm-kitty
abbr -a :wo kitty @ detach-window --target-tab=new # Kitty (Moves pane to new tab)
abbr -a :wot kitty @ detach-window # Kitty (Same as above, default behavior)
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wo wezterm cli move-pane-to-new-tab --new-window # WezTerm
abbr -a :wot wezterm cli move-pane-to-new-tab # WezTerm
end
# Window Detach (Move Pane)
if test "$TERM" = xterm-kitty
abbr -a :wo kitty @ detach-window --target-tab=new # Kitty (Moves pane to new tab)
abbr -a :wot kitty @ detach-window # Kitty (Same as above, default behavior)
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wo wezterm cli move-pane-to-new-tab --new-window # WezTerm
abbr -a :wot wezterm cli move-pane-to-new-tab # WezTerm
end
# Tab Creation
if test "$TERM" = xterm-kitty
abbr -a :t kitty @ launch --type=tab # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :t wezterm cli spawn # WezTerm
end
# Tab Creation
if test "$TERM" = xterm-kitty
abbr -a :t kitty @ launch --type=tab # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :t wezterm cli spawn # WezTerm
end
# Rename Tab
if test "$TERM" = xterm-kitty
abbr -a :tl "kitty @ set-tab-title" # Kitty -> Usage: :tl "New Title"
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tl wezterm cli set-tab-title # WezTerm
end
# Rename Tab
if test "$TERM" = xterm-kitty
abbr -a :tl "kitty @ set-tab-title" # Kitty -> Usage: :tl "New Title"
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tl wezterm cli set-tab-title # WezTerm
end
# Rename Window
if test "$TERM" = xterm-kitty
abbr -a :tw "kitty @ set-window-title" # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tw wezterm cli set-window-title # WezTerm
end
# Rename Window
if test "$TERM" = xterm-kitty
abbr -a :tw "kitty @ set-window-title" # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tw wezterm cli set-window-title # WezTerm
end
# Rename Workspace
if test "$TERM_PROGRAM" = WezTerm
abbr -a :twk wezterm cli rename-workspace # WezTerm
end
# Kitty does not have a direct CLI equivalent for renaming a dynamic "workspace" session.
# Rename Workspace
if test "$TERM_PROGRAM" = WezTerm
abbr -a :twk wezterm cli rename-workspace # WezTerm
end
# Kitty does not have a direct CLI equivalent for renaming a dynamic "workspace" session.
# Tab Navigation
if test "$TERM" = xterm-kitty
abbr -a :tp "kitty @ focus-tab --match neighbor:left" # Kitty
abbr -a :tn "kitty @ focus-tab --match neighbor:right" # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tp wezterm cli activate-tab --tab-relative -1 # WezTerm
abbr -a :tn wezterm cli activate-tab --tab-relative 1 # WezTerm
end
# Tab Navigation
if test "$TERM" = xterm-kitty
abbr -a :tp "kitty @ focus-tab --match neighbor:left" # Kitty
abbr -a :tn "kitty @ focus-tab --match neighbor:right" # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tp wezterm cli activate-tab --tab-relative -1 # WezTerm
abbr -a :tn wezterm cli activate-tab --tab-relative 1 # WezTerm
end
# Specialty Tab Shortcuts (New Tab in specific dir)
if test "$TERM" = xterm-kitty
abbr -a :tgk kitty @ launch --type=tab --cwd ~/.config/kitty # Kitty
abbr -a :tgn kitty @ launch --type=tab --cwd ~/.config/nvim # Kitty
abbr -a :tgf kitty @ launch --type=tab --cwd ~/.config/fish # Kitty
abbr -a :tgh kitty @ launch --type=tab --cwd ~
abbr -a :tgcz kitty @ launch --type=tab --cwd ~/.local/share/chezmoi # Kitty
abbr -a :tgcm kitty @ launch --type=tab --cwd ~/.config/chezmoi # Kitty
abbr -a :tgp kitty @ launch --type=tab --cwd ~/projects # Kitty
abbr -a :tgr kitty @ launch --type=tab -- sudo -i
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tgk wezterm cli spawn --cwd ~/.config/kitty # WezTerm
abbr -a :tgn wezterm cli spawn --cwd ~/.config/nvim # WezTerm
abbr -a :tgf wezterm cli spawn --cwd ~/.config/fish # WezTerm
abbr -a :tgh wezterm cli spawn --cwd ~ # WezTerm
abbr -a :tgcz wezterm cli spawn --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :tgcm wezterm cli spawn --cwd ~/.config/chezmoi # WezTerm
abbr -a :tgp wezterm cli spawn --cwd ~/projects # WezTerm
abbr -a :tgr wezterm cli spawn -- sudo -i # WezTerm
end
# Specialty Tab Shortcuts (New Tab in specific dir)
if test "$TERM" = xterm-kitty
abbr -a :tgk kitty @ launch --type=tab --cwd ~/.config/kitty # Kitty
abbr -a :tgn kitty @ launch --type=tab --cwd ~/.config/nvim # Kitty
abbr -a :tgf kitty @ launch --type=tab --cwd ~/.config/fish # Kitty
abbr -a :tgh kitty @ launch --type=tab --cwd ~
abbr -a :tgcz kitty @ launch --type=tab --cwd ~/.local/share/chezmoi # Kitty
abbr -a :tgcm kitty @ launch --type=tab --cwd ~/.config/chezmoi # Kitty
abbr -a :tgp kitty @ launch --type=tab --cwd ~/projects # Kitty
abbr -a :tgr kitty @ launch --type=tab -- sudo -i
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :tgk wezterm cli spawn --cwd ~/.config/kitty # WezTerm
abbr -a :tgn wezterm cli spawn --cwd ~/.config/nvim # WezTerm
abbr -a :tgf wezterm cli spawn --cwd ~/.config/fish # WezTerm
abbr -a :tgh wezterm cli spawn --cwd ~ # WezTerm
abbr -a :tgcz wezterm cli spawn --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :tgcm wezterm cli spawn --cwd ~/.config/chezmoi # WezTerm
abbr -a :tgp wezterm cli spawn --cwd ~/projects # WezTerm
abbr -a :tgr wezterm cli spawn -- sudo -i # WezTerm
end
# Specialty Window Shortcuts (New OS Window in specific dir)
if test "$TERM" = xterm-kitty
abbr -a :wgk kitty @ launch --type=os-window --cwd ~/.config/kitty # Kitty
abbr -a :wgn kitty @ launch --type=os-window --cwd ~/.config/nvim # Kitty
abbr -a :wgf kitty @ launch --type=os-window --cwd ~/.config/fish # Kitty
abbr -a :wgh kitty @ launch --type=os-window --cwd ~
abbr -a :wgzd kitty @ launch --type=os-window --cwd ~/.local/share/chezmoi # Kitty
abbr -a :wgcz kitty @ launch --type=os-window --cwd ~/.config/chezmoi # Kitty
abbr -a :wgp kitty @ launch --type=os-window --cwd ~/projects # Kitty
abbr -a :wgr kitty @ launch --type=os-window -- sudo -i # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wgk wezterm cli spawn --new-window --cwd ~/.config/kitty # WezTerm
abbr -a :wgn wezterm cli spawn --new-window --cwd ~/.config/nvim # WezTerm
abbr -a :wgf wezterm cli spawn --new-window --cwd ~/.config/fish # WezTerm
abbr -a :wgh wezterm cli spawn --new-window --cwd ~ # WezTerm
abbr -a :wgzd wezterm cli spawn --new-window --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :wgcz wezterm cli spawn --new-window --cwd ~/.config/chezmoi # WezTerm
abbr -a :wgp wezterm cli spawn --new-window --cwd ~/projects # WezTerm
abbr -a :wgr wezterm cli spawn --new-window -- sudo -i # WezTerm
end
# Specialty Window Shortcuts (New OS Window in specific dir)
if test "$TERM" = xterm-kitty
abbr -a :wgk kitty @ launch --type=os-window --cwd ~/.config/kitty # Kitty
abbr -a :wgn kitty @ launch --type=os-window --cwd ~/.config/nvim # Kitty
abbr -a :wgf kitty @ launch --type=os-window --cwd ~/.config/fish # Kitty
abbr -a :wgh kitty @ launch --type=os-window --cwd ~
abbr -a :wgzd kitty @ launch --type=os-window --cwd ~/.local/share/chezmoi # Kitty
abbr -a :wgcz kitty @ launch --type=os-window --cwd ~/.config/chezmoi # Kitty
abbr -a :wgp kitty @ launch --type=os-window --cwd ~/projects # Kitty
abbr -a :wgr kitty @ launch --type=os-window -- sudo -i # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wgk wezterm cli spawn --new-window --cwd ~/.config/kitty # WezTerm
abbr -a :wgn wezterm cli spawn --new-window --cwd ~/.config/nvim # WezTerm
abbr -a :wgf wezterm cli spawn --new-window --cwd ~/.config/fish # WezTerm
abbr -a :wgh wezterm cli spawn --new-window --cwd ~ # WezTerm
abbr -a :wgzd wezterm cli spawn --new-window --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :wgcz wezterm cli spawn --new-window --cwd ~/.config/chezmoi # WezTerm
abbr -a :wgp wezterm cli spawn --new-window --cwd ~/projects # WezTerm
abbr -a :wgr wezterm cli spawn --new-window -- sudo -i # WezTerm
end
# Specialty Window Vertical Shortcuts (Split Bottom)
if test "$TERM" = xterm-kitty
abbr -a :wvgk kitty @ launch --location=hsplit --cwd ~/.config/kitty # Kitty
abbr -a :wvgn kitty @ launch --location=hsplit --cwd ~/.config/nvim # Kitty
abbr -a :wvgf kitty @ launch --location=hsplit --cwd ~/.config/fish # Kitty
abbr -a :wvgh kitty @ launch --location=hsplit --cwd ~ # Kitty
abbr -a :wvgcz kitty @ launch --location=hsplit --cwd ~/.local/share/chezmoi # Kitty
abbr -a :wvgcm kitty @ launch --location=hsplit --cwd ~/.config/chezmoi # Kitty
abbr -a :wvgp kitty @ launch --location=hsplit --cwd ~/projects # Kitty
abbr -a :wvgr kitty @ launch --location=hsplit -- sudo -i # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wvgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # WezTerm
abbr -a :wvgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
abbr -a :wvgf wezterm cli split-pane --bottom --cwd ~/.config/fish # WezTerm
abbr -a :wvgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
abbr -a :wvgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :wvgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
abbr -a :wvgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
abbr -a :wvgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
end
# Specialty Window Vertical Shortcuts (Split Bottom)
if test "$TERM" = xterm-kitty
abbr -a :wvgk kitty @ launch --location=hsplit --cwd ~/.config/kitty # Kitty
abbr -a :wvgn kitty @ launch --location=hsplit --cwd ~/.config/nvim # Kitty
abbr -a :wvgf kitty @ launch --location=hsplit --cwd ~/.config/fish # Kitty
abbr -a :wvgh kitty @ launch --location=hsplit --cwd ~ # Kitty
abbr -a :wvgcz kitty @ launch --location=hsplit --cwd ~/.local/share/chezmoi # Kitty
abbr -a :wvgcm kitty @ launch --location=hsplit --cwd ~/.config/chezmoi # Kitty
abbr -a :wvgp kitty @ launch --location=hsplit --cwd ~/projects # Kitty
abbr -a :wvgr kitty @ launch --location=hsplit -- sudo -i # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :wvgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # WezTerm
abbr -a :wvgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
abbr -a :wvgf wezterm cli split-pane --bottom --cwd ~/.config/fish # WezTerm
abbr -a :wvgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
abbr -a :wvgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :wvgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
abbr -a :wvgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
abbr -a :wvgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
end
# Specialty Window Horizontal Shortcuts (Split Right)
if test "$TERM" = xterm-kitty
abbr -a :whgk kitty @ launch --location=vsplit --cwd ~/.config/kitty # Kitty
abbr -a :whgn kitty @ launch --location=vsplit --cwd ~/.config/nvim # Kitty
abbr -a :whgf kitty @ launch --location=vsplit --cwd ~/.config/fish # Kitty
abbr -a :whgh kitty @ launch --location=vsplit --cwd ~ # Kitty
abbr -a :whgcz kitty @ launch --location=vsplit --cwd ~/.local/share/chezmoi # Kitty
abbr -a :whgcm kitty @ launch --location=vsplit --cwd ~/.config/chezmoi # Kitty
abbr -a :whgp kitty @ launch --location=vsplit --cwd ~/projects # Kitty
abbr -a :whgr kitty @ launch --location=vsplit --cwd current sudo -i # Kitty -> Specialty cd Shortcuts
abbr -a :cdk 'cd ~/.config/kitty/ # Kitty Config'
abbr -a :cdkn 'cd ~/.config/kitty;nvim'
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :whgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # WezTerm
abbr -a :whgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
abbr -a :whgf wezterm cli split-pane --bottom --cwd ~/.config/fish # WezTerm
abbr -a :whgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
abbr -a :whgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :whgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
abbr -a :whgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
abbr -a :whgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
end
abbr -a :cdn cd '~/.config/nvim/ # Neovim Config'
abbr -a :cdnn 'cd ~/.config/nvim;nvim'
abbr -a :cdf 'cd ~/.config/fish/ # Fish Config'
abbr -a :cdfn 'cd ~/.config/fish;nvim'
abbr -a :cdh 'cd ~ # Home Directory'
abbr -a :cdhn 'cd ~;nvim'
abbr -a :cdcz cd '~/.local/share/chezmoi/ # Chezmoi Source'
abbr -a :cdczn 'cd ~/.local/share/chezmoi;nvim'
abbr -a :cdcm 'cd ~/.config/chezmoi/ # Chezmoi Config'
abbr -a :cdcmn 'cd ~/.config/chezmoi;nvim'
abbr -a :cdp --regex ':cdp' --set-cursor 'cd ~/projects/%'
# abbr -a cdp_slash --position anywhere --regex ':cdp/' --set-cursor 'cd ~/projects/%'
abbr -a :cdpn 'cd ~/projects;nvim'
abbr -a :cdw 'cd ~/.config/wezterm/ # WezTerm Config'
abbr -a :cdwn 'cd ~/.config/wezterm;nvim'
if test "$TERM" = xterm-kitty
abbr -a editt kitty @ launch --type tab nvim
end
# Spawn window
if test "$TERM" = xterm-kitty
abbr -a :sw spwin
# Specialty Window Horizontal Shortcuts (Split Right)
if test "$TERM" = xterm-kitty
abbr -a :whgk kitty @ launch --location=vsplit --cwd ~/.config/kitty # Kitty
abbr -a :whgn kitty @ launch --location=vsplit --cwd ~/.config/nvim # Kitty
abbr -a :whgf kitty @ launch --location=vsplit --cwd ~/.config/fish # Kitty
abbr -a :whgh kitty @ launch --location=vsplit --cwd ~ # Kitty
abbr -a :whgcz kitty @ launch --location=vsplit --cwd ~/.local/share/chezmoi # Kitty
abbr -a :whgcm kitty @ launch --location=vsplit --cwd ~/.config/chezmoi # Kitty
abbr -a :whgp kitty @ launch --location=vsplit --cwd ~/projects # Kitty
abbr -a :whgr kitty @ launch --location=vsplit --cwd current sudo -i # Kitty -> Specialty cd Shortcuts
abbr -a :cdk 'cd ~/.config/kitty/ # Kitty Config'
abbr -a :cdkn 'cd ~/.config/kitty;nvim'
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a :whgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # WezTerm
abbr -a :whgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
abbr -a :whgf wezterm cli split-pane --bottom --cwd ~/.config/fish # WezTerm
abbr -a :whgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
abbr -a :whgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :whgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
abbr -a :whgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
abbr -a :whgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
end
abbr -a :cdn cd '~/.config/nvim/ # Neovim Config'
abbr -a :cdnn 'cd ~/.config/nvim;nvim'
abbr -a :cdf 'cd ~/.config/fish/ # Fish Config'
abbr -a :cdfn 'cd ~/.config/fish;nvim'
abbr -a :cdh 'cd ~ # Home Directory'
abbr -a :cdhn 'cd ~;nvim'
abbr -a :cdcz cd '~/.local/share/chezmoi/ # Chezmoi Source'
abbr -a :cdczn 'cd ~/.local/share/chezmoi;nvim'
abbr -a :cdcm 'cd ~/.config/chezmoi/ # Chezmoi Config'
abbr -a :cdcmn 'cd ~/.config/chezmoi;nvim'
abbr -a :cdp --regex ':cdp' --set-cursor 'cd ~/projects/%'
# abbr -a cdp_slash --position anywhere --regex ':cdp/' --set-cursor 'cd ~/projects/%'
abbr -a :cdpn 'cd ~/projects;nvim'
abbr -a :cdw 'cd ~/.config/wezterm/ # WezTerm Config'
abbr -a :cdwn 'cd ~/.config/wezterm;nvim'
if test "$TERM" = xterm-kitty
abbr -a editt kitty @ launch --type tab nvim
end
# Spawn window
if test "$TERM" = xterm-kitty
abbr -a :sw spwin
end
end
### Docker ###
@@ -307,9 +314,13 @@ abbr -a sscs 'sudo systemctl start'
abbr -a sscr 'sudo systemctl restart'
### History Expansions and Substitutions ###
abbr -a !^ --position anywhere --function expand_bang_caret
abbr -a '!*' --position anywhere --function expand_bang_all
abbr -a typo_sub --position anywhere --regex '\^([^^]+)\^([^^]*)' --function expand_typo_sub
abbr -a bang_string --position anywhere --regex '![\w.-]+' --function expand_bang_string
abbr -a bang_search --position anywhere --regex '!\?[\w.-]+\??' --function expand_bang_search
abbr -a bang_minus_n --position anywhere --regex '!-(\d+)' --function expand_bang_minus_n
# Bash-style history expansion is opinionated (C3 overrides), gated atomically
# with conf.d/tricks.fish, conf.d/puffer.fish, and functions/expand_*.fish.
if __fish_config_op_enabled __fish_config_op_overrides
abbr -a !^ --position anywhere --function expand_bang_caret
abbr -a '!*' --position anywhere --function expand_bang_all
abbr -a typo_sub --position anywhere --regex '\^([^^]+)\^([^^]*)' --function expand_typo_sub
abbr -a bang_string --position anywhere --regex '![\w.-]+' --function expand_bang_string
abbr -a bang_search --position anywhere --regex '!\?[\w.-]+\??' --function expand_bang_search
abbr -a bang_minus_n --position anywhere --regex '!-(\d+)' --function expand_bang_minus_n
end
+4
View File
@@ -1,5 +1,9 @@
status is-interactive || exit
# Local modification: opinionated guard (AGENTS.md Task #3). Bracket
# auto-pairing intercepts single-character input, classified as C3 overrides.
__fish_config_op_enabled __fish_config_op_overrides || exit
set --global autopair_left "(" "[" "{" '"' "'"
set --global autopair_right ")" "]" "}" '"' "'"
set --global autopair_pairs "()" "[]" "{}" '""' "''"
+4
View File
@@ -24,6 +24,10 @@ if not status is-interactive
exit
end
# Local modification: opinionated guard (AGENTS.md Task #3). Desktop
# notifications assume a graphical session, classified as C4 integrations.
__fish_config_op_enabled __fish_config_op_integrations; or exit
set -g __done_version 1.19.1
function __done_run_powershell_script
+8
View File
@@ -29,6 +29,14 @@ echo " Run 'help config' for offline documentation."
echo " Run 'fish-deps' to check and install dependencies."
echo ""
# ─────────────────────── Opinionated auto-exec guard ────────────────────
# Startup side-effects below (Fisher curl, fisher update, theme apply) are
# opinionated (C2 auto-execution). The first-run state variable is already
# set above either way, so disabling auto-exec never re-triggers this file.
if not __fish_config_op_enabled __fish_config_op_autoexec
return
end
# ──────────────────────────── Bootstrap Fisher ──────────────────────────
if not type -q fisher
echo " [first-run] Installing Fisher plugin manager..."
+4
View File
@@ -46,6 +46,10 @@
function fish_user_key_bindings
# Custom key chords are opinionated (C3 overrides); skip them entirely
# when overrides are disabled so stock bindings remain untouched.
__fish_config_op_enabled __fish_config_op_overrides; or return
# ───────────────────────────── Set Bindings ─────────────────────────────
#
# Set Emacs mode bindings:
+4
View File
@@ -5,6 +5,10 @@
# /usr/bin/paru is installed. The wrapper tees paru output to a
# timestamped log file and prunes old logs, mirroring smart_exit behavior.
# Auto-generating a wrapper in ~/.local/bin is opinionated (C2 auto-exec).
# Task #4's __fish_config_enable_logging will additionally gate this wrapper.
__fish_config_op_enabled __fish_config_op_autoexec; or return
set -l _paru_real /usr/bin/paru
set -l _paru_wrapper "$HOME/.local/bin/paru"
set -l _paru_wrapper_version 1
+5
View File
@@ -1,5 +1,10 @@
status is-interactive || exit
# Local modification: opinionated guard (AGENTS.md Task #3). Puffer's key
# intercepts are part of the bang-bang system, gated atomically under C3
# overrides with conf.d/tricks.fish, conf.d/abbr.fish, and expand_*.fish.
__fish_config_op_enabled __fish_config_op_overrides || exit
function _puffer_fish_key_bindings --on-variable fish_key_bindings
set -l modes
if test "$fish_key_bindings" = fish_default_key_bindings
+3
View File
@@ -5,6 +5,9 @@
# Without starship, fish's built-in prompt already emits OSC 133;A
# on the prompt line itself, so no wrapper is needed.
# Replacing the prompt is opinionated (C3 overrides)
__fish_config_op_enabled __fish_config_op_overrides; or return
type -q starship; or return
function fish_prompt
+10
View File
@@ -6,6 +6,16 @@
# ╰──────────────────────────────────────────────────────────╯
# Catppuccin Mocha
# Forcing theme colors and $FZF_DEFAULT_OPTS is opinionated (C3 overrides).
# The FZF variable is universal, so clean up our Catppuccin value if it
# lingers from a session where overrides were still enabled.
if not __fish_config_op_enabled __fish_config_op_overrides
if set -q FZF_DEFAULT_OPTS; and string match -q '*#1E1E2E*' -- "$FZF_DEFAULT_OPTS"
set --erase FZF_DEFAULT_OPTS
end
return
end
# ────────────────────── Syntax highlighting colors ──────────────────────
set --global fish_color_autosuggestion 6c7086
set --global fish_color_cancel f38ba8
+50 -36
View File
@@ -29,7 +29,8 @@ if test -f $_src; and not test -L $_man1/fish-config.1
end
# Format man pages using bat (only if bat is installed)
if type -q bat
# Overriding $MANPAGER is opinionated (C3 overrides)
if type -q bat; and __fish_config_op_enabled __fish_config_op_overrides
set -gx MANROFFOPT -c
set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'"
end
@@ -40,38 +41,46 @@ set -gx __done_notification_urgency_level low
## Functions
# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
function __history_previous_command
switch (commandline -t)
case "!"
commandline -t $history[1]
commandline -f repaint
case "*"
commandline -i !
# The bang-bang system is opinionated (C3 overrides) and is gated atomically
# here, in conf.d/abbr.fish, conf.d/puffer.fish, and functions/expand_*.fish.
if __fish_config_op_enabled __fish_config_op_overrides
function __history_previous_command
switch (commandline -t)
case "!"
commandline -t $history[1]
commandline -f repaint
case "*"
commandline -i !
end
end
end
function __history_previous_command_arguments
switch (commandline -t)
case "!"
commandline -t ""
commandline -f history-token-search-backward
case "*"
commandline -i '$'
function __history_previous_command_arguments
switch (commandline -t)
case "!"
commandline -t ""
commandline -f history-token-search-backward
case "*"
commandline -i '$'
end
end
end
# Apply bang-bang key bindings based on current key binding mode
if [ "$fish_key_bindings" = fish_vi_key_bindings ]
bind -Minsert ! __history_previous_command
bind -Minsert '$' __history_previous_command_arguments
else
bind ! __history_previous_command
bind '$' __history_previous_command_arguments
# Apply bang-bang key bindings based on current key binding mode
if [ "$fish_key_bindings" = fish_vi_key_bindings ]
bind -Minsert ! __history_previous_command
bind -Minsert '$' __history_previous_command_arguments
else
bind ! __history_previous_command
bind '$' __history_previous_command_arguments
end
end
# Fish command history override to show timestamps
function history
builtin history --show-time='%F %T '
# Shadowing the history command is opinionated (C1 aliasing); when disabled,
# the function is never defined and fish's stock history behavior applies.
if __fish_config_op_enabled __fish_config_op_aliases
function history
builtin history --show-time='%F %T '
end
end
# Quick file backup utility
@@ -97,21 +106,26 @@ alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
# Tools & Core command color overrides
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Silent flag injection into POSIX tools is opinionated (C1 aliasing)
if __fish_config_op_enabled __fish_config_op_aliases
# Tools & Core command color overrides
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Safety aliases (Confirmation before overwriting/deleting)
alias cp="cp -i"
alias mv="mv -i"
# Safety aliases (Confirmation before overwriting/deleting)
alias cp="cp -i"
alias mv="mv -i"
# Force wget to resume partial downloads
alias wget='wget -c '
end
# Archives and networking short-hands
alias tarnow='tar -acf '
alias untar='tar -zxvf '
alias wget='wget -c '
alias tb='nc termbin.com 9999'
# System Logs
+6
View File
@@ -5,6 +5,12 @@
# see: https://github.com/ik11235/wakatime.fish
###
# Local modification: opinionated guard (AGENTS.md Task #3). WakaTime
# reporting is classified under both C2 auto-execution and C4 integrations;
# disabling either category skips registering the hook.
__fish_config_op_enabled __fish_config_op_autoexec; or exit
__fish_config_op_enabled __fish_config_op_integrations; or exit
function __register_wakatime_fish_before_exec -e fish_postexec
if set -q FISH_WAKATIME_DISABLED
return 0
+4
View File
@@ -5,6 +5,10 @@
# /usr/bin/yay is installed. The wrapper tees yay output to a
# timestamped log file and prunes old logs, mirroring smart_exit behavior.
# Auto-generating a wrapper in ~/.local/bin is opinionated (C2 auto-exec).
# Task #4's __fish_config_enable_logging will additionally gate this wrapper.
__fish_config_op_enabled __fish_config_op_autoexec; or return
set -l _yay_real /usr/bin/yay
set -l _yay_wrapper "$HOME/.local/bin/yay"
set -l _yay_wrapper_version 1
+5 -1
View File
@@ -63,7 +63,11 @@ if status is-interactive
# -------------
alias cd=z
# Shadowing cd with zoxide is opinionated (C1 aliasing); z and zi
# remain available either way.
if __fish_config_op_enabled __fish_config_op_aliases
alias cd=z
end
# use custom completion
complete -c z -f # disable files by default
+67 -15
View File
@@ -5,17 +5,57 @@
# │ Fish Configuration │
# ╰──────────────────────────────────────────────────────────╯
# ───────────────────── Opinionated component guards ─────────────────────
# Opinionated components (AGENTS.md Task #3) are wrapped in
# __fish_config_op_enabled <category> guards throughout this file and conf.d/.
# The helper always evaluates the master switch __fish_config_opinionated
# first (falsy disables everything), then the per-category opt-out variable:
# __fish_config_op_aliases C1 — command shadows / flag injection
# __fish_config_op_autoexec C2 — startup side-effects
# __fish_config_op_overrides C3 — key bindings, env, prompt overrides
# __fish_config_op_integrations C4 — terminal/tool coupling
# Example: set -U __fish_config_op_aliases off (erase to re-enable)
# ──────────────────────── Source CachyOS configs ────────────────────────
if test -f /usr/share/cachyos-fish-config/cachyos-config.fish
source /usr/share/cachyos-fish-config/cachyos-config.fish
# Source our tricks over the cachyOS config
test -f "$__fish_config_dir/conf.d/tricks.fish"
and source "$__fish_config_dir/conf.d/tricks.fish"
# Erase CachyOS aliases/functions that shadow our versions, then
# re-source our versions since functions --erase removes autoload entries.
for _fname in ls lt cleanup copy
functions --erase $_fname
source "$__fish_config_dir/functions/$_fname.fish"
# Surgically overriding the distro config is opinionated (C3 overrides):
# skip it entirely when overrides are disabled, keeping CachyOS defaults.
if __fish_config_op_enabled __fish_config_op_overrides
# Source our tricks over the cachyOS config
test -f "$__fish_config_dir/conf.d/tricks.fish"
and source "$__fish_config_dir/conf.d/tricks.fish"
# Erase CachyOS aliases/functions that shadow our versions, then
# re-source our versions since functions --erase removes autoload entries.
for _fname in ls lt cleanup copy
functions --erase $_fname
source "$__fish_config_dir/functions/$_fname.fish"
end
end
# The distro config ships opinionated pieces of its own (it is the origin
# of tricks.fish); strip them when the matching category is disabled so
# the guards hold on CachyOS systems too.
if not __fish_config_op_enabled __fish_config_op_aliases
for _fname in grep fgrep egrep dir vdir wget
functions -q $_fname; and functions --erase $_fname
end
# Restore fish's stock versions where they exist (erasing alone would
# also block autoloading the stock function).
for _fname in history ls
functions -q $_fname; and functions --erase $_fname
test -f $__fish_data_dir/functions/$_fname.fish
and source $__fish_data_dir/functions/$_fname.fish
end
end
if not __fish_config_op_enabled __fish_config_op_overrides
for _fname in __history_previous_command __history_previous_command_arguments
functions -q $_fname; and functions --erase $_fname
end
bind --erase ! 2>/dev/null
bind --erase '$' 2>/dev/null
bind -M insert --erase ! 2>/dev/null
bind -M insert --erase '$' 2>/dev/null
end
end
set --erase _fname
@@ -47,10 +87,13 @@ set -gx CODEIUM_HOME "$XDG_CONFIG_HOME/codeium"
set -gx WORDLIST "$XDG_CONFIG_HOME/hunspell_en_US"
# ─────────────────────────── Pager variables ────────────────────────────
if type -q ov
set -gx PAGER ov
else if type -q less
set -gx PAGER less
# Overriding $PAGER is opinionated (C3 overrides)
if __fish_config_op_enabled __fish_config_op_overrides
if type -q ov
set -gx PAGER ov
else if type -q less
set -gx PAGER less
end
end
# ─────────────────────────── Editor variables ───────────────────────────
@@ -76,7 +119,9 @@ set -gx SCROLLBACK_HISTORY_DIR "$HOME/.terminal_history"
# Maximum number of scrollback history files to keep
set -gx SCROLLBACK_HISTORY_MAX_FILES 100
# Wire up a clean exit function that won't fire on background subshells
if status is-interactive
# Replacing the exit builtin is opinionated (C3 overrides); smart_exit also
# guards itself so a live toggle takes effect without restarting the shell.
if status is-interactive; and __fish_config_op_enabled __fish_config_op_overrides
function exit --description 'Safe interactive exit'
# If the smart_exit file exists in our function path, invoke it explicitly
if functions -q smart_exit
@@ -112,7 +157,10 @@ fish_add_path $HOME/.fzf/bin # Fuzzy Finder (fzf) core binary an
# Additionally, directories inside the CWD will still take precedence over CDPATH,
# so if you have a directory named 'myproject' in the current directory,
# running 'cd myproject' will take you there instead of $HOME/projects/myproject.
set -gx CDPATH . $HOME/projects $HOME
# CDPATH injection is opinionated (C3 overrides)
if __fish_config_op_enabled __fish_config_op_overrides
set -gx CDPATH . $HOME/projects $HOME
end
# ──────────────────────────── Bootstrap Fisher ──────────────────────────
# Fisher is bootstrapped automatically on first run via conf.d/first_run.fish
@@ -123,7 +171,11 @@ if status is-interactive
# ────────────────────────────── Key bindings ────────────────────────────
# Helps ensure that key bindings are consistent with the Vi editing mode set below.
# This is optional but can improve the user experience for those who prefer Vi-style key bindings.
set -g fish_key_bindings fish_vi_key_bindings
# Global Vi mode is opinionated (C3 overrides); without it fish keeps its
# default Emacs-style bindings.
if __fish_config_op_enabled __fish_config_op_overrides
set -g fish_key_bindings fish_vi_key_bindings
end
# ──────────────────────── Source FZF integration ────────────────────────
# Prefer fzf's own fish integration (fzf --fish, available since fzf 0.48)
+5
View File
@@ -162,6 +162,11 @@ local=## Machine-local Configuration
secrets=## Secrets and API Keys
overrides=## Overriding Configuration Variables
universal=## Fish Universal Variables
opinionated=## Opinionated Components (Minimal Mode)
minimal=## Opinionated Components (Minimal Mode)
minimal-mode=## Opinionated Components (Minimal Mode)
opt-out=## Opinionated Components (Minimal Mode)
toggles=## Opinionated Components (Minimal Mode)
# ── Section 8: Fisher Plugins ─────────────────────────────────
plugins=# 8. FISHER PLUGINS
+59
View File
@@ -156,6 +156,10 @@ automatically on exit. Use `logs` to browse them interactively.
CLAUDE_CODE_NO_FLICKER 1 — suppress terminal flicker in Claude Code
CDPATH . ~/projects ~
Opinionated defaults (CDPATH, PAGER/MANPAGER, Vi mode, command shadows,
terminal integrations) can be switched off per category with universal
variables — see Section 7, "Opinionated Components (Minimal Mode)".
## Pager Hierarchy
$PAGER is set to ov when available, falling back to less. The less wrapper
@@ -1375,6 +1379,61 @@ Some settings (fzf colors, theme) are stored in fish_variables via
`set -U`. These are machine-local and git-ignored. Do not commit
fish_variables.
## Opinionated Components (Minimal Mode)
Every opinionated piece of this config is active by default but can be
switched off through four category opt-out variables, each evaluated via
__fish_variable_check. Set a variable to any falsy value (0, false, no,
off, n) to disable its category; erase it or set a truthy value (1, true,
yes, on, y) to re-enable. Unset means enabled.
Variable Disables
------------------------------ ------------------------------------
__fish_config_op_aliases Command shadows and flag injection:
ls->eza, cat->bat, cd->zoxide,
rm->trash, less->ov, top->btop,
ping->prettyping, ssh->kitten,
du->duf/dust, mkdir/bash wrappers,
history timestamps, grep/cp/mv/wget
flag injection, help intercept
__fish_config_op_autoexec Startup side-effects: Fisher
bootstrap, theme apply, paru/yay
wrapper generation, auto venv
activation, WakaTime hook
__fish_config_op_overrides Key and env overrides: Vi mode,
exit->smart_exit, PAGER/MANPAGER,
CDPATH, bang-bang system, autopair,
puffer, starship prompt, theme
colors, FZF_DEFAULT_OPTS, right
prompt
__fish_config_op_integrations Terminal/tool coupling: Kitty/
WezTerm window abbreviations, done
notifications, spwin/tab/split,
hist, logs, upgrade, WakaTime
Examples:
# Disable command shadows only (rm becomes plain rm again):
set -U __fish_config_op_aliases off
# Full minimal mode — disable all four categories at once:
set -U __fish_config_opinionated 0
# Re-enable everything:
set -Ue __fish_config_opinionated
Notes:
- Command shadows (rm, cat, ls, ...) react immediately; conf.d-level
components (bindings, prompt, abbreviations, hooks) take effect in
new shells.
- With aliases disabled, rm falls back to bare `command rm` — files
are deleted permanently, not trashed.
- Disabled integration commands (spwin, tab, split, hist, logs,
upgrade) print an error naming the variable that disabled them.
- On CachyOS, the distro fish config's own aliases, history override,
and bang-bang bindings are stripped per category as well.
## Prompt and Theme
### Starship
+4 -1
View File
@@ -14,7 +14,10 @@
# cd ~/myproject # activates .venv if present
function __auto_source_fallback_venv --on-variable PWD
status --is-command-substitution; and return
# Opinionated guard (C2): no automatic venv activation when disabled.
__fish_config_op_enabled __fish_config_op_autoexec; or return
# 1. Skip if direnv is already managing this directory
if set -q DIRENV_DIR; or test -e ".envrc"
return
+46
View File
@@ -0,0 +1,46 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# SYNOPSIS
# __fish_config_op_enabled <category_variable>
#
# DESCRIPTION
# Guard predicate for opinionated components (AGENTS.md Task #3). The master
# switch __fish_config_opinionated is always evaluated first via
# __fish_variable_check: a falsy master value (0/false/no/off/n) disables
# every category at once, regardless of the category variable's own value.
# Otherwise the supplied category variable is evaluated the same way.
# Unset or empty variables (status 2) and unrecognized values (status 3)
# leave the component enabled — opinionated components are active by
# default and these variables are pure opt-out knobs.
#
# ARGUMENTS
# category_variable Name (without $) of the category opt-out variable:
# __fish_config_op_aliases, __fish_config_op_autoexec,
# __fish_config_op_overrides, or
# __fish_config_op_integrations
#
# RETURNS
# 0 Component enabled (variables truthy, unset, or unrecognized)
# 1 Component disabled (master or category variable is falsy)
#
# EXAMPLE
# if __fish_config_op_enabled __fish_config_op_aliases
# alias grep='grep --color=auto'
# end
function __fish_config_op_enabled --description 'Check whether an opinionated component category is enabled'
# Master switch first: falsy disables all categories unconditionally.
__fish_variable_check __fish_config_opinionated
if test $status -eq 1
return 1
end
# Category variable: only an explicit falsy value disables the category.
# Truthy (0), unset/empty (2), and garbage (3) all keep it enabled.
__fish_variable_check $argv[1]
if test $status -eq 1
return 1
end
return 0
end
+6
View File
@@ -14,6 +14,12 @@
# EXAMPLE
# bash
function bash --wraps='bash' --description 'bash switches to bash shell'
# Opinionated guard (C1): fall back to bare command bash when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command bash $argv
return $status
end
set SHELL $(which bash) # Set shell to bash
command bash --rcfile "$XDG_CONFIG_HOME/bash/bashrc" $argv # Run bash
set SHELL $(which fish) # Reset shell
+7 -1
View File
@@ -15,7 +15,13 @@
# EXAMPLE
# cat README.md
function cat --wraps='bat' --description 'Use bat for files, ls for directories, and raw cat for ANSI logs'
# If no arguments are provided, cat usually waits for stdin.
# Opinionated guard (C1): fall back to bare command cat when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command cat $argv
return $status
end
# If no arguments are provided, cat usually waits for stdin.
# We'll maintain that behavior by skipping the directory check if $argv is empty.
if set -q argv[1]
if test -d $argv[1]
+6
View File
@@ -18,6 +18,12 @@
# EXAMPLE
# du ~/Downloads
function du --description 'Execute du'
# Opinionated guard (C1): fall back to bare command du when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command du $argv
return $status
end
set cmd ""
set args
+3
View File
@@ -1,5 +1,8 @@
# Execute expand_bang_all
function expand_bang_all --description 'Execute expand_bang_all'
# Opinionated guard (C3): no expansion when overrides are disabled.
__fish_config_op_enabled __fish_config_op_overrides; or return 1
set -l token $argv[1]
if test -z "$token"; set token (commandline -t); end
+3
View File
@@ -1,5 +1,8 @@
# Execute expand_bang_caret
function expand_bang_caret --description 'Execute expand_bang_caret'
# Opinionated guard (C3): no expansion when overrides are disabled.
__fish_config_op_enabled __fish_config_op_overrides; or return 1
# Split the last history item into a list
set -l tokens (string split -n ' ' -- $history[1])
# tokens[1] is the command, tokens[2] is the first argument
+3
View File
@@ -1,5 +1,8 @@
# Execute expand_bang_minus_n
function expand_bang_minus_n --description 'Execute expand_bang_minus_n'
# Opinionated guard (C3): no expansion when overrides are disabled.
__fish_config_op_enabled __fish_config_op_overrides; or return 1
set -l token $argv[1]
if test -z "$token"; set token (commandline -t); end
+3
View File
@@ -1,5 +1,8 @@
# Execute expand_bang_search
function expand_bang_search --description 'Execute expand_bang_search'
# Opinionated guard (C3): no expansion when overrides are disabled.
__fish_config_op_enabled __fish_config_op_overrides; or return 1
set -l token $argv[1]
if test -z "$token"
set token (commandline -t)
+3
View File
@@ -1,5 +1,8 @@
# Execute expand_bang_string
function expand_bang_string --description 'Execute expand_bang_string'
# Opinionated guard (C3): no expansion when overrides are disabled.
__fish_config_op_enabled __fish_config_op_overrides; or return 1
# Fish 4.x passes the matched token as argv[1]
set -l token $argv[1]
if test -z "$token"
+4 -1
View File
@@ -1,6 +1,9 @@
# Execute expand_typo_sub
function expand_typo_sub --description 'Execute expand_typo_sub'
# In newer Fish, the matched token is often passed as $argv[1]
# Opinionated guard (C3): no expansion when overrides are disabled.
__fish_config_op_enabled __fish_config_op_overrides; or return 1
# In newer Fish, the matched token is often passed as $argv[1]
# if the abbr is set up correctly. We'll fallback to commandline just in case.
set -l last_cmd $history[1]
set -l current_token $argv[1]
+3
View File
@@ -11,6 +11,9 @@
# EXAMPLE
# # Rendered automatically by Fish shell; not called directly.
function fish_right_prompt --description 'Execute fish_right_prompt'
# Opinionated guard (C3): no right prompt when overrides are disabled.
__fish_config_op_enabled __fish_config_op_overrides; or return
# 1. Docker Context in Blue
set -l docker_ctx (docker context show 2>/dev/null)
if test -n "$docker_ctx"; and test "$docker_ctx" != default
+6
View File
@@ -66,6 +66,12 @@ end
# --- Wrapper Definition ---
function help --wraps help --description "Custom wrapper to intercept 'help config'"
# Opinionated guard (C1): fall back to the native fish help when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
__original_help $argv
return $status
end
if test "$argv[1]" = config
# All arguments after 'config' — including flags (-w/--html, -m/--man,
# -h/--help) and section keywords — are forwarded to config-help.
+8
View File
@@ -11,6 +11,14 @@
# EXAMPLE
# hist
function hist --description 'Search fish history and put it in the prompt'
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled __fish_config_op_integrations
set -l c_err (set_color red)
set -l c_reset (set_color normal)
echo "$c_err"'hist: disabled by __fish_config_op_integrations'"$c_reset" >&2
return 1
end
set -l selected (history | fzf --reverse --height 40% --with-nth 3..)
if test -n "$selected"
+6
View File
@@ -14,6 +14,12 @@
# EXAMPLE
# less /var/log/syslog
function less --wraps='ov' --description 'Pager wrapper: $PAGER → ov → less → more → cat'
# Opinionated guard (C1): fall back to bare command less when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command less $argv
return $status
end
if set -q PAGER; and command -q $PAGER
command $PAGER $argv
else if command -q ov
+8
View File
@@ -19,6 +19,14 @@
# EXAMPLE
# logs -c paru
function logs --description 'Browse terminal log files interactively with fzf'
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled __fish_config_op_integrations
set -l c_err (set_color red)
set -l c_reset (set_color normal)
echo "$c_err"'logs: disabled by __fish_config_op_integrations'"$c_reset" >&2
return 1
end
set -l options h/help c/category=
argparse $options -- $argv
or return 1
+6
View File
@@ -14,6 +14,12 @@
# EXAMPLE
# ls ~/projects
function ls --description 'List all files'
# Opinionated guard (C1): fall back to bare command ls when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command ls $argv
return $status
end
if which eza >/dev/null 2>&1
eza -l -a --icons --color=auto --hyperlink $argv
+6
View File
@@ -16,6 +16,12 @@
# EXAMPLE
# mkdir ~/projects/myapp/src
function mkdir --description 'Execute mkdir'
# Opinionated guard (C1): fall back to bare command mkdir when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command mkdir $argv
return $status
end
if status is-interactive
# Fall back to command mkdir -p when flags are present (e.g. -m 755)
for _arg in $argv
+6
View File
@@ -17,6 +17,12 @@
# ping google.com
# ping --legend google.com
function ping --description 'prettyping with default nolegend'
# Opinionated guard (C1): fall back to bare command ping when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command ping $argv
return $status
end
if command -q prettyping
# Check if the user specifically asked for the legend
if contains -- --legend $argv
+6
View File
@@ -15,6 +15,12 @@
# EXAMPLE
# rg "TODO" src/
function rg --description 'alias rg=rg --hyperlink-format=kitty'
# Opinionated guard (C1): fall back to bare command rg when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command rg $argv
return $status
end
if test "$TERM" = xterm-kitty
command rg --hyperlink-format=kitty $argv
else
+10
View File
@@ -11,6 +11,10 @@
# deletes via rm -rf and triggers fstrim. Plain paths and -r/-R are sent
# to trash put; any other flags fall back to system rm.
#
# Opinionated component (C1): when disabled via __fish_config_op_aliases
# (or the __fish_config_opinionated master), behaves exactly like bare
# command rm — no wrapper, no trash, no trapping.
#
# ARGUMENTS
# (none) List current trash contents
# -e, --empty [opts] Empty the trash; opts forwarded to trash empty
@@ -27,6 +31,12 @@
# rm -e
# rm -S sensitive_key.pem
function rm --description 'Ultimate rm: trash, list, empty, and secure-erase'
# Opinionated guard (C1): fall back to bare command rm when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command rm $argv
return $status
end
# 1. No arguments: Show the Trash contents (Quick view)
if not set -q argv[1]
if type -q trash
+7
View File
@@ -20,6 +20,13 @@
# EXAMPLE
# smart_exit --no-log
function smart_exit --description 'Capture colorized scrollback before exiting, with pruning and safe overrides'
# Opinionated guard (C3): exit plainly when overrides are disabled.
# This composes with Task #4's __fish_config_enable_logging, which will
# gate only the scrollback capture while leaving the exit wrapper active.
if not __fish_config_op_enabled __fish_config_op_overrides
builtin exit $argv
end
set -l options h/help n/no-log
argparse $options -- $argv
or return 1
+8
View File
@@ -23,6 +23,14 @@
# split
# split -v nvim README.md
function split --description 'Run a command in a new terminal split'
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled __fish_config_op_integrations
set -l c_err (set_color red)
set -l c_reset (set_color normal)
echo "$c_err"'split: disabled by __fish_config_op_integrations'"$c_reset" >&2
return 1
end
set -l is_kitty 0
set -l is_wezterm 0
+8
View File
@@ -18,6 +18,14 @@
# EXAMPLE
# spwin
function spwin --wraps='~/.config/kitty/spawn-window.sh' --description 'spawn window in kitty or wezterm'
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled __fish_config_op_integrations
set -l c_err (set_color red)
set -l c_reset (set_color normal)
echo "$c_err"'spwin: disabled by __fish_config_op_integrations'"$c_reset" >&2
return 1
end
if test "$TERM" = xterm-kitty
if test -x ~/.config/kitty/spawn-window.sh
~/.config/kitty/spawn-window.sh $argv
+6
View File
@@ -15,6 +15,12 @@
# EXAMPLE
# ssh user@host
function ssh --description 'Alias ssh to kitten ssh when using Kitty terminal'
# Opinionated guard (C1): fall back to bare command ssh when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command ssh $argv
return $status
end
if test "$TERM" = xterm-kitty
kitten ssh $argv
else
+8
View File
@@ -19,6 +19,14 @@
# EXAMPLE
# tab
function tab --description 'Spawn a new tab in the current terminal'
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled __fish_config_op_integrations
set -l c_err (set_color red)
set -l c_reset (set_color normal)
echo "$c_err"'tab: disabled by __fish_config_op_integrations'"$c_reset" >&2
return 1
end
set -l dir "$cdto"
if test -z "$dir"
set dir "$PWD"
+6
View File
@@ -14,6 +14,12 @@
# EXAMPLE
# top
function top --wraps='btop' --description 'Use btop as a modern replacement for top'
# Opinionated guard (C1): fall back to bare command top when disabled.
if not __fish_config_op_enabled __fish_config_op_aliases
command top $argv
return $status
end
# 1. Check if btop is actually installed
if type -q btop
# 2. Launch btop with any arguments passed
+8
View File
@@ -15,6 +15,14 @@
# EXAMPLE
# upgrade
function upgrade --description 'Full system upgrade via paru or yay'
# Opinionated guard (C4): integrations disabled
if not __fish_config_op_enabled __fish_config_op_integrations
set -l c_err (set_color red)
set -l c_reset (set_color normal)
echo "$c_err"'upgrade: disabled by __fish_config_op_integrations'"$c_reset" >&2
return 1
end
set -l aur ""
if type -q paru
set aur paru