Compare commits
4 Commits
cdf850f2e7
...
e30fc7a15c
| Author | SHA1 | Date | |
|---|---|---|---|
|
e30fc7a15c
|
|||
|
7bd080769e
|
|||
|
dc97892a29
|
|||
|
ce84db593c
|
@@ -11,6 +11,7 @@ abbreviation system for keyboard-driven workflows.
|
|||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Personalization](#personalization)
|
- [Personalization](#personalization)
|
||||||
|
- [Minimal Mode](#minimal-mode)
|
||||||
- [Attribution](#attribution)
|
- [Attribution](#attribution)
|
||||||
- [License](#license)
|
- [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
|
- **Kitty terminal** deep integration for splits, tabs, and SSH
|
||||||
- **AI workflow** helpers for Claude and Antigravity session management
|
- **AI workflow** helpers for Claude and Antigravity session management
|
||||||
- **WakaTime** shell activity tracking
|
- **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
|
## 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.
|
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
@@ -76,13 +76,16 @@ abbr -a ag antigravity
|
|||||||
abbr -a ag. antigravity .
|
abbr -a ag. antigravity .
|
||||||
# Quit
|
# Quit
|
||||||
abbr -a /exit exit
|
abbr -a /exit exit
|
||||||
if test "$TERM" = xterm-kitty
|
# Window-management abbreviations are opinionated (C4 integrations)
|
||||||
abbr -a :q kitty @ close-window # Kitty (Closes the active split/pane)
|
if __fish_config_op_enabled __fish_config_op_integrations
|
||||||
abbr -a :Q kitty @ close-tab # Kitty (Closes the whole tab)
|
if test "$TERM" = xterm-kitty
|
||||||
end
|
abbr -a :q kitty @ close-window # Kitty (Closes the active split/pane)
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
abbr -a :Q kitty @ close-tab # Kitty (Closes the whole tab)
|
||||||
abbr -a :q wezterm cli kill-pane # WezTerm
|
end
|
||||||
abbr -a :Q wezterm cli kill-pane # WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
|
abbr -a :q wezterm cli kill-pane # WezTerm
|
||||||
|
abbr -a :Q wezterm cli kill-pane # WezTerm
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
######### Alternates ##########
|
######### Alternates ##########
|
||||||
@@ -103,184 +106,188 @@ abbr -a lsT lstree
|
|||||||
# Speedtest using fast.com
|
# Speedtest using fast.com
|
||||||
abbr -a speedtest-fast fast-cli
|
abbr -a speedtest-fast fast-cli
|
||||||
|
|
||||||
# Window Creation (OS Windows)
|
# Kitty/WezTerm window-management abbreviations are opinionated (C4
|
||||||
if test "$TERM" = xterm-kitty
|
# integrations): they assume an active Kitty or WezTerm session.
|
||||||
abbr -a :w kitty @ launch --type=os-window # Kitty
|
if __fish_config_op_enabled __fish_config_op_integrations
|
||||||
end
|
# Window Creation (OS Windows)
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :w wezterm cli spawn --new-window # WezTerm
|
abbr -a :w kitty @ launch --type=os-window # Kitty
|
||||||
end
|
end
|
||||||
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
|
abbr -a :w wezterm cli spawn --new-window # WezTerm
|
||||||
|
end
|
||||||
|
|
||||||
# Window Splits (Panes)
|
# Window Splits (Panes)
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :wv kitty @ launch --location=hsplit # Kitty (Horizontal split)
|
abbr -a :wv kitty @ launch --location=hsplit # Kitty (Horizontal split)
|
||||||
abbr -a :wh kitty @ launch --location=vsplit # Kitty (Vertical split)
|
abbr -a :wh kitty @ launch --location=vsplit # Kitty (Vertical split)
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :wv wezterm cli split-pane --bottom # WezTerm
|
abbr -a :wv wezterm cli split-pane --bottom # WezTerm
|
||||||
abbr -a :wh wezterm cli split-pane --right # WezTerm
|
abbr -a :wh wezterm cli split-pane --right # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Window Detach (Move Pane)
|
# Window Detach (Move Pane)
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :wo kitty @ detach-window --target-tab=new # Kitty (Moves pane to new tab)
|
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)
|
abbr -a :wot kitty @ detach-window # Kitty (Same as above, default behavior)
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :wo wezterm cli move-pane-to-new-tab --new-window # 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
|
abbr -a :wot wezterm cli move-pane-to-new-tab # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Tab Creation
|
# Tab Creation
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :t kitty @ launch --type=tab # Kitty
|
abbr -a :t kitty @ launch --type=tab # Kitty
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :t wezterm cli spawn # WezTerm
|
abbr -a :t wezterm cli spawn # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Rename Tab
|
# Rename Tab
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :tl "kitty @ set-tab-title" # Kitty -> Usage: :tl "New Title"
|
abbr -a :tl "kitty @ set-tab-title" # Kitty -> Usage: :tl "New Title"
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :tl wezterm cli set-tab-title # WezTerm
|
abbr -a :tl wezterm cli set-tab-title # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Rename Window
|
# Rename Window
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :tw "kitty @ set-window-title" # Kitty
|
abbr -a :tw "kitty @ set-window-title" # Kitty
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :tw wezterm cli set-window-title # WezTerm
|
abbr -a :tw wezterm cli set-window-title # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Rename Workspace
|
# Rename Workspace
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :twk wezterm cli rename-workspace # WezTerm
|
abbr -a :twk wezterm cli rename-workspace # WezTerm
|
||||||
end
|
end
|
||||||
# Kitty does not have a direct CLI equivalent for renaming a dynamic "workspace" session.
|
# Kitty does not have a direct CLI equivalent for renaming a dynamic "workspace" session.
|
||||||
|
|
||||||
# Tab Navigation
|
# Tab Navigation
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :tp "kitty @ focus-tab --match neighbor:left" # Kitty
|
abbr -a :tp "kitty @ focus-tab --match neighbor:left" # Kitty
|
||||||
abbr -a :tn "kitty @ focus-tab --match neighbor:right" # Kitty
|
abbr -a :tn "kitty @ focus-tab --match neighbor:right" # Kitty
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :tp wezterm cli activate-tab --tab-relative -1 # WezTerm
|
abbr -a :tp wezterm cli activate-tab --tab-relative -1 # WezTerm
|
||||||
abbr -a :tn wezterm cli activate-tab --tab-relative 1 # WezTerm
|
abbr -a :tn wezterm cli activate-tab --tab-relative 1 # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Specialty Tab Shortcuts (New Tab in specific dir)
|
# Specialty Tab Shortcuts (New Tab in specific dir)
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :tgk kitty @ launch --type=tab --cwd ~/.config/kitty # 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 :tgn kitty @ launch --type=tab --cwd ~/.config/nvim # Kitty
|
||||||
abbr -a :tgf kitty @ launch --type=tab --cwd ~/.config/fish # Kitty
|
abbr -a :tgf kitty @ launch --type=tab --cwd ~/.config/fish # Kitty
|
||||||
abbr -a :tgh kitty @ launch --type=tab --cwd ~
|
abbr -a :tgh kitty @ launch --type=tab --cwd ~
|
||||||
abbr -a :tgcz kitty @ launch --type=tab --cwd ~/.local/share/chezmoi # Kitty
|
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 :tgcm kitty @ launch --type=tab --cwd ~/.config/chezmoi # Kitty
|
||||||
abbr -a :tgp kitty @ launch --type=tab --cwd ~/projects # Kitty
|
abbr -a :tgp kitty @ launch --type=tab --cwd ~/projects # Kitty
|
||||||
abbr -a :tgr kitty @ launch --type=tab -- sudo -i
|
abbr -a :tgr kitty @ launch --type=tab -- sudo -i
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :tgk wezterm cli spawn --cwd ~/.config/kitty # WezTerm
|
abbr -a :tgk wezterm cli spawn --cwd ~/.config/kitty # WezTerm
|
||||||
abbr -a :tgn wezterm cli spawn --cwd ~/.config/nvim # WezTerm
|
abbr -a :tgn wezterm cli spawn --cwd ~/.config/nvim # WezTerm
|
||||||
abbr -a :tgf wezterm cli spawn --cwd ~/.config/fish # WezTerm
|
abbr -a :tgf wezterm cli spawn --cwd ~/.config/fish # WezTerm
|
||||||
abbr -a :tgh wezterm cli spawn --cwd ~ # WezTerm
|
abbr -a :tgh wezterm cli spawn --cwd ~ # WezTerm
|
||||||
abbr -a :tgcz wezterm cli spawn --cwd ~/.local/share/chezmoi # WezTerm
|
abbr -a :tgcz wezterm cli spawn --cwd ~/.local/share/chezmoi # WezTerm
|
||||||
abbr -a :tgcm wezterm cli spawn --cwd ~/.config/chezmoi # WezTerm
|
abbr -a :tgcm wezterm cli spawn --cwd ~/.config/chezmoi # WezTerm
|
||||||
abbr -a :tgp wezterm cli spawn --cwd ~/projects # WezTerm
|
abbr -a :tgp wezterm cli spawn --cwd ~/projects # WezTerm
|
||||||
abbr -a :tgr wezterm cli spawn -- sudo -i # WezTerm
|
abbr -a :tgr wezterm cli spawn -- sudo -i # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Specialty Window Shortcuts (New OS Window in specific dir)
|
# Specialty Window Shortcuts (New OS Window in specific dir)
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :wgk kitty @ launch --type=os-window --cwd ~/.config/kitty # 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 :wgn kitty @ launch --type=os-window --cwd ~/.config/nvim # Kitty
|
||||||
abbr -a :wgf kitty @ launch --type=os-window --cwd ~/.config/fish # Kitty
|
abbr -a :wgf kitty @ launch --type=os-window --cwd ~/.config/fish # Kitty
|
||||||
abbr -a :wgh kitty @ launch --type=os-window --cwd ~
|
abbr -a :wgh kitty @ launch --type=os-window --cwd ~
|
||||||
abbr -a :wgzd kitty @ launch --type=os-window --cwd ~/.local/share/chezmoi # Kitty
|
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 :wgcz kitty @ launch --type=os-window --cwd ~/.config/chezmoi # Kitty
|
||||||
abbr -a :wgp kitty @ launch --type=os-window --cwd ~/projects # Kitty
|
abbr -a :wgp kitty @ launch --type=os-window --cwd ~/projects # Kitty
|
||||||
abbr -a :wgr kitty @ launch --type=os-window -- sudo -i # Kitty
|
abbr -a :wgr kitty @ launch --type=os-window -- sudo -i # Kitty
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :wgk wezterm cli spawn --new-window --cwd ~/.config/kitty # 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 :wgn wezterm cli spawn --new-window --cwd ~/.config/nvim # WezTerm
|
||||||
abbr -a :wgf wezterm cli spawn --new-window --cwd ~/.config/fish # 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 :wgh wezterm cli spawn --new-window --cwd ~ # WezTerm
|
||||||
abbr -a :wgzd wezterm cli spawn --new-window --cwd ~/.local/share/chezmoi # 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 :wgcz wezterm cli spawn --new-window --cwd ~/.config/chezmoi # WezTerm
|
||||||
abbr -a :wgp wezterm cli spawn --new-window --cwd ~/projects # WezTerm
|
abbr -a :wgp wezterm cli spawn --new-window --cwd ~/projects # WezTerm
|
||||||
abbr -a :wgr wezterm cli spawn --new-window -- sudo -i # WezTerm
|
abbr -a :wgr wezterm cli spawn --new-window -- sudo -i # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Specialty Window Vertical Shortcuts (Split Bottom)
|
# Specialty Window Vertical Shortcuts (Split Bottom)
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :wvgk kitty @ launch --location=hsplit --cwd ~/.config/kitty # 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 :wvgn kitty @ launch --location=hsplit --cwd ~/.config/nvim # Kitty
|
||||||
abbr -a :wvgf kitty @ launch --location=hsplit --cwd ~/.config/fish # Kitty
|
abbr -a :wvgf kitty @ launch --location=hsplit --cwd ~/.config/fish # Kitty
|
||||||
abbr -a :wvgh kitty @ launch --location=hsplit --cwd ~ # Kitty
|
abbr -a :wvgh kitty @ launch --location=hsplit --cwd ~ # Kitty
|
||||||
abbr -a :wvgcz kitty @ launch --location=hsplit --cwd ~/.local/share/chezmoi # 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 :wvgcm kitty @ launch --location=hsplit --cwd ~/.config/chezmoi # Kitty
|
||||||
abbr -a :wvgp kitty @ launch --location=hsplit --cwd ~/projects # Kitty
|
abbr -a :wvgp kitty @ launch --location=hsplit --cwd ~/projects # Kitty
|
||||||
abbr -a :wvgr kitty @ launch --location=hsplit -- sudo -i # Kitty
|
abbr -a :wvgr kitty @ launch --location=hsplit -- sudo -i # Kitty
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :wvgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # 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 :wvgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
|
||||||
abbr -a :wvgf wezterm cli split-pane --bottom --cwd ~/.config/fish # 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 :wvgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
|
||||||
abbr -a :wvgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # 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 :wvgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
|
||||||
abbr -a :wvgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
|
abbr -a :wvgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
|
||||||
abbr -a :wvgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
|
abbr -a :wvgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
|
||||||
end
|
end
|
||||||
|
|
||||||
# Specialty Window Horizontal Shortcuts (Split Right)
|
# Specialty Window Horizontal Shortcuts (Split Right)
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :whgk kitty @ launch --location=vsplit --cwd ~/.config/kitty # 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 :whgn kitty @ launch --location=vsplit --cwd ~/.config/nvim # Kitty
|
||||||
abbr -a :whgf kitty @ launch --location=vsplit --cwd ~/.config/fish # Kitty
|
abbr -a :whgf kitty @ launch --location=vsplit --cwd ~/.config/fish # Kitty
|
||||||
abbr -a :whgh kitty @ launch --location=vsplit --cwd ~ # Kitty
|
abbr -a :whgh kitty @ launch --location=vsplit --cwd ~ # Kitty
|
||||||
abbr -a :whgcz kitty @ launch --location=vsplit --cwd ~/.local/share/chezmoi # 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 :whgcm kitty @ launch --location=vsplit --cwd ~/.config/chezmoi # Kitty
|
||||||
abbr -a :whgp kitty @ launch --location=vsplit --cwd ~/projects # 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 :whgr kitty @ launch --location=vsplit --cwd current sudo -i # Kitty -> Specialty cd Shortcuts
|
||||||
abbr -a :cdk 'cd ~/.config/kitty/ # Kitty Config'
|
abbr -a :cdk 'cd ~/.config/kitty/ # Kitty Config'
|
||||||
abbr -a :cdkn 'cd ~/.config/kitty;nvim'
|
abbr -a :cdkn 'cd ~/.config/kitty;nvim'
|
||||||
end
|
end
|
||||||
if test "$TERM_PROGRAM" = WezTerm
|
if test "$TERM_PROGRAM" = WezTerm
|
||||||
abbr -a :whgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # 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 :whgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
|
||||||
abbr -a :whgf wezterm cli split-pane --bottom --cwd ~/.config/fish # 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 :whgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
|
||||||
abbr -a :whgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # 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 :whgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
|
||||||
abbr -a :whgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
|
abbr -a :whgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
|
||||||
abbr -a :whgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
|
abbr -a :whgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
|
||||||
end
|
end
|
||||||
abbr -a :cdn cd '~/.config/nvim/ # Neovim Config'
|
abbr -a :cdn cd '~/.config/nvim/ # Neovim Config'
|
||||||
abbr -a :cdnn 'cd ~/.config/nvim;nvim'
|
abbr -a :cdnn 'cd ~/.config/nvim;nvim'
|
||||||
abbr -a :cdf 'cd ~/.config/fish/ # Fish Config'
|
abbr -a :cdf 'cd ~/.config/fish/ # Fish Config'
|
||||||
abbr -a :cdfn 'cd ~/.config/fish;nvim'
|
abbr -a :cdfn 'cd ~/.config/fish;nvim'
|
||||||
abbr -a :cdh 'cd ~ # Home Directory'
|
abbr -a :cdh 'cd ~ # Home Directory'
|
||||||
abbr -a :cdhn 'cd ~;nvim'
|
abbr -a :cdhn 'cd ~;nvim'
|
||||||
abbr -a :cdcz cd '~/.local/share/chezmoi/ # Chezmoi Source'
|
abbr -a :cdcz cd '~/.local/share/chezmoi/ # Chezmoi Source'
|
||||||
abbr -a :cdczn 'cd ~/.local/share/chezmoi;nvim'
|
abbr -a :cdczn 'cd ~/.local/share/chezmoi;nvim'
|
||||||
abbr -a :cdcm 'cd ~/.config/chezmoi/ # Chezmoi Config'
|
abbr -a :cdcm 'cd ~/.config/chezmoi/ # Chezmoi Config'
|
||||||
abbr -a :cdcmn 'cd ~/.config/chezmoi;nvim'
|
abbr -a :cdcmn 'cd ~/.config/chezmoi;nvim'
|
||||||
abbr -a :cdp --regex ':cdp' --set-cursor 'cd ~/projects/%'
|
abbr -a :cdp --regex ':cdp' --set-cursor 'cd ~/projects/%'
|
||||||
# abbr -a cdp_slash --position anywhere --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 :cdpn 'cd ~/projects;nvim'
|
||||||
abbr -a :cdw 'cd ~/.config/wezterm/ # WezTerm Config'
|
abbr -a :cdw 'cd ~/.config/wezterm/ # WezTerm Config'
|
||||||
abbr -a :cdwn 'cd ~/.config/wezterm;nvim'
|
abbr -a :cdwn 'cd ~/.config/wezterm;nvim'
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a editt kitty @ launch --type tab nvim
|
abbr -a editt kitty @ launch --type tab nvim
|
||||||
end
|
end
|
||||||
# Spawn window
|
# Spawn window
|
||||||
if test "$TERM" = xterm-kitty
|
if test "$TERM" = xterm-kitty
|
||||||
abbr -a :sw spwin
|
abbr -a :sw spwin
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
### Docker ###
|
### Docker ###
|
||||||
@@ -307,9 +314,13 @@ abbr -a sscs 'sudo systemctl start'
|
|||||||
abbr -a sscr 'sudo systemctl restart'
|
abbr -a sscr 'sudo systemctl restart'
|
||||||
|
|
||||||
### History Expansions and Substitutions ###
|
### History Expansions and Substitutions ###
|
||||||
abbr -a !^ --position anywhere --function expand_bang_caret
|
# Bash-style history expansion is opinionated (C3 overrides), gated atomically
|
||||||
abbr -a '!*' --position anywhere --function expand_bang_all
|
# with conf.d/tricks.fish, conf.d/puffer.fish, and functions/expand_*.fish.
|
||||||
abbr -a typo_sub --position anywhere --regex '\^([^^]+)\^([^^]*)' --function expand_typo_sub
|
if __fish_config_op_enabled __fish_config_op_overrides
|
||||||
abbr -a bang_string --position anywhere --regex '![\w.-]+' --function expand_bang_string
|
abbr -a !^ --position anywhere --function expand_bang_caret
|
||||||
abbr -a bang_search --position anywhere --regex '!\?[\w.-]+\??' --function expand_bang_search
|
abbr -a '!*' --position anywhere --function expand_bang_all
|
||||||
abbr -a bang_minus_n --position anywhere --regex '!-(\d+)' --function expand_bang_minus_n
|
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
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
status is-interactive || exit
|
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_left "(" "[" "{" '"' "'"
|
||||||
set --global autopair_right ")" "]" "}" '"' "'"
|
set --global autopair_right ")" "]" "}" '"' "'"
|
||||||
set --global autopair_pairs "()" "[]" "{}" '""' "''"
|
set --global autopair_pairs "()" "[]" "{}" '""' "''"
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ if not status is-interactive
|
|||||||
exit
|
exit
|
||||||
end
|
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
|
set -g __done_version 1.19.1
|
||||||
|
|
||||||
function __done_run_powershell_script
|
function __done_run_powershell_script
|
||||||
|
|||||||
@@ -29,6 +29,14 @@ echo " Run 'help config' for offline documentation."
|
|||||||
echo " Run 'fish-deps' to check and install dependencies."
|
echo " Run 'fish-deps' to check and install dependencies."
|
||||||
echo ""
|
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 ──────────────────────────
|
# ──────────────────────────── Bootstrap Fisher ──────────────────────────
|
||||||
if not type -q fisher
|
if not type -q fisher
|
||||||
echo " [first-run] Installing Fisher plugin manager..."
|
echo " [first-run] Installing Fisher plugin manager..."
|
||||||
|
|||||||
@@ -46,6 +46,10 @@
|
|||||||
|
|
||||||
function fish_user_key_bindings
|
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 Bindings ─────────────────────────────
|
||||||
#
|
#
|
||||||
# Set Emacs mode bindings:
|
# Set Emacs mode bindings:
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
# /usr/bin/paru is installed. The wrapper tees paru output to a
|
# /usr/bin/paru is installed. The wrapper tees paru output to a
|
||||||
# timestamped log file and prunes old logs, mirroring smart_exit behavior.
|
# 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_real /usr/bin/paru
|
||||||
set -l _paru_wrapper "$HOME/.local/bin/paru"
|
set -l _paru_wrapper "$HOME/.local/bin/paru"
|
||||||
set -l _paru_wrapper_version 1
|
set -l _paru_wrapper_version 1
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
status is-interactive || exit
|
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
|
function _puffer_fish_key_bindings --on-variable fish_key_bindings
|
||||||
set -l modes
|
set -l modes
|
||||||
if test "$fish_key_bindings" = fish_default_key_bindings
|
if test "$fish_key_bindings" = fish_default_key_bindings
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
# Without starship, fish's built-in prompt already emits OSC 133;A
|
# Without starship, fish's built-in prompt already emits OSC 133;A
|
||||||
# on the prompt line itself, so no wrapper is needed.
|
# 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
|
type -q starship; or return
|
||||||
|
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
|
|||||||
@@ -6,6 +6,16 @@
|
|||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
# Catppuccin Mocha
|
# 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 ──────────────────────
|
# ────────────────────── Syntax highlighting colors ──────────────────────
|
||||||
set --global fish_color_autosuggestion 6c7086
|
set --global fish_color_autosuggestion 6c7086
|
||||||
set --global fish_color_cancel f38ba8
|
set --global fish_color_cancel f38ba8
|
||||||
|
|||||||
+50
-36
@@ -29,7 +29,8 @@ if test -f $_src; and not test -L $_man1/fish-config.1
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Format man pages using bat (only if bat is installed)
|
# 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 MANROFFOPT -c
|
||||||
set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
||||||
end
|
end
|
||||||
@@ -40,38 +41,46 @@ set -gx __done_notification_urgency_level low
|
|||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
|
# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
|
||||||
function __history_previous_command
|
# The bang-bang system is opinionated (C3 overrides) and is gated atomically
|
||||||
switch (commandline -t)
|
# here, in conf.d/abbr.fish, conf.d/puffer.fish, and functions/expand_*.fish.
|
||||||
case "!"
|
if __fish_config_op_enabled __fish_config_op_overrides
|
||||||
commandline -t $history[1]
|
function __history_previous_command
|
||||||
commandline -f repaint
|
switch (commandline -t)
|
||||||
case "*"
|
case "!"
|
||||||
commandline -i !
|
commandline -t $history[1]
|
||||||
|
commandline -f repaint
|
||||||
|
case "*"
|
||||||
|
commandline -i !
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function __history_previous_command_arguments
|
function __history_previous_command_arguments
|
||||||
switch (commandline -t)
|
switch (commandline -t)
|
||||||
case "!"
|
case "!"
|
||||||
commandline -t ""
|
commandline -t ""
|
||||||
commandline -f history-token-search-backward
|
commandline -f history-token-search-backward
|
||||||
case "*"
|
case "*"
|
||||||
commandline -i '$'
|
commandline -i '$'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Apply bang-bang key bindings based on current key binding mode
|
# Apply bang-bang key bindings based on current key binding mode
|
||||||
if [ "$fish_key_bindings" = fish_vi_key_bindings ]
|
if [ "$fish_key_bindings" = fish_vi_key_bindings ]
|
||||||
bind -Minsert ! __history_previous_command
|
bind -Minsert ! __history_previous_command
|
||||||
bind -Minsert '$' __history_previous_command_arguments
|
bind -Minsert '$' __history_previous_command_arguments
|
||||||
else
|
else
|
||||||
bind ! __history_previous_command
|
bind ! __history_previous_command
|
||||||
bind '$' __history_previous_command_arguments
|
bind '$' __history_previous_command_arguments
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Fish command history override to show timestamps
|
# Fish command history override to show timestamps
|
||||||
function history
|
# Shadowing the history command is opinionated (C1 aliasing); when disabled,
|
||||||
builtin history --show-time='%F %T '
|
# 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
|
end
|
||||||
|
|
||||||
# Quick file backup utility
|
# Quick file backup utility
|
||||||
@@ -97,21 +106,26 @@ alias ....='cd ../../..'
|
|||||||
alias .....='cd ../../../..'
|
alias .....='cd ../../../..'
|
||||||
alias ......='cd ../../../../..'
|
alias ......='cd ../../../../..'
|
||||||
|
|
||||||
# Tools & Core command color overrides
|
# Silent flag injection into POSIX tools is opinionated (C1 aliasing)
|
||||||
alias dir='dir --color=auto'
|
if __fish_config_op_enabled __fish_config_op_aliases
|
||||||
alias vdir='vdir --color=auto'
|
# Tools & Core command color overrides
|
||||||
alias grep='grep --color=auto'
|
alias dir='dir --color=auto'
|
||||||
alias fgrep='fgrep --color=auto'
|
alias vdir='vdir --color=auto'
|
||||||
alias egrep='egrep --color=auto'
|
alias grep='grep --color=auto'
|
||||||
|
alias fgrep='fgrep --color=auto'
|
||||||
|
alias egrep='egrep --color=auto'
|
||||||
|
|
||||||
# Safety aliases (Confirmation before overwriting/deleting)
|
# Safety aliases (Confirmation before overwriting/deleting)
|
||||||
alias cp="cp -i"
|
alias cp="cp -i"
|
||||||
alias mv="mv -i"
|
alias mv="mv -i"
|
||||||
|
|
||||||
|
# Force wget to resume partial downloads
|
||||||
|
alias wget='wget -c '
|
||||||
|
end
|
||||||
|
|
||||||
# Archives and networking short-hands
|
# Archives and networking short-hands
|
||||||
alias tarnow='tar -acf '
|
alias tarnow='tar -acf '
|
||||||
alias untar='tar -zxvf '
|
alias untar='tar -zxvf '
|
||||||
alias wget='wget -c '
|
|
||||||
alias tb='nc termbin.com 9999'
|
alias tb='nc termbin.com 9999'
|
||||||
|
|
||||||
# System Logs
|
# System Logs
|
||||||
|
|||||||
@@ -5,6 +5,12 @@
|
|||||||
# see: https://github.com/ik11235/wakatime.fish
|
# 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
|
function __register_wakatime_fish_before_exec -e fish_postexec
|
||||||
if set -q FISH_WAKATIME_DISABLED
|
if set -q FISH_WAKATIME_DISABLED
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
# /usr/bin/yay is installed. The wrapper tees yay output to a
|
# /usr/bin/yay is installed. The wrapper tees yay output to a
|
||||||
# timestamped log file and prunes old logs, mirroring smart_exit behavior.
|
# 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_real /usr/bin/yay
|
||||||
set -l _yay_wrapper "$HOME/.local/bin/yay"
|
set -l _yay_wrapper "$HOME/.local/bin/yay"
|
||||||
set -l _yay_wrapper_version 1
|
set -l _yay_wrapper_version 1
|
||||||
|
|||||||
+5
-1
@@ -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
|
# use custom completion
|
||||||
complete -c z -f # disable files by default
|
complete -c z -f # disable files by default
|
||||||
|
|||||||
+67
-15
@@ -5,17 +5,57 @@
|
|||||||
# │ Fish Configuration │
|
# │ 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 ────────────────────────
|
# ──────────────────────── Source CachyOS configs ────────────────────────
|
||||||
if test -f /usr/share/cachyos-fish-config/cachyos-config.fish
|
if test -f /usr/share/cachyos-fish-config/cachyos-config.fish
|
||||||
source /usr/share/cachyos-fish-config/cachyos-config.fish
|
source /usr/share/cachyos-fish-config/cachyos-config.fish
|
||||||
# Source our tricks over the cachyOS config
|
# Surgically overriding the distro config is opinionated (C3 overrides):
|
||||||
test -f "$__fish_config_dir/conf.d/tricks.fish"
|
# skip it entirely when overrides are disabled, keeping CachyOS defaults.
|
||||||
and source "$__fish_config_dir/conf.d/tricks.fish"
|
if __fish_config_op_enabled __fish_config_op_overrides
|
||||||
# Erase CachyOS aliases/functions that shadow our versions, then
|
# Source our tricks over the cachyOS config
|
||||||
# re-source our versions since functions --erase removes autoload entries.
|
test -f "$__fish_config_dir/conf.d/tricks.fish"
|
||||||
for _fname in ls lt cleanup copy
|
and source "$__fish_config_dir/conf.d/tricks.fish"
|
||||||
functions --erase $_fname
|
# Erase CachyOS aliases/functions that shadow our versions, then
|
||||||
source "$__fish_config_dir/functions/$_fname.fish"
|
# 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
|
||||||
end
|
end
|
||||||
set --erase _fname
|
set --erase _fname
|
||||||
@@ -47,10 +87,13 @@ set -gx CODEIUM_HOME "$XDG_CONFIG_HOME/codeium"
|
|||||||
set -gx WORDLIST "$XDG_CONFIG_HOME/hunspell_en_US"
|
set -gx WORDLIST "$XDG_CONFIG_HOME/hunspell_en_US"
|
||||||
|
|
||||||
# ─────────────────────────── Pager variables ────────────────────────────
|
# ─────────────────────────── Pager variables ────────────────────────────
|
||||||
if type -q ov
|
# Overriding $PAGER is opinionated (C3 overrides)
|
||||||
set -gx PAGER ov
|
if __fish_config_op_enabled __fish_config_op_overrides
|
||||||
else if type -q less
|
if type -q ov
|
||||||
set -gx PAGER less
|
set -gx PAGER ov
|
||||||
|
else if type -q less
|
||||||
|
set -gx PAGER less
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# ─────────────────────────── Editor variables ───────────────────────────
|
# ─────────────────────────── Editor variables ───────────────────────────
|
||||||
@@ -76,7 +119,9 @@ set -gx SCROLLBACK_HISTORY_DIR "$HOME/.terminal_history"
|
|||||||
# Maximum number of scrollback history files to keep
|
# Maximum number of scrollback history files to keep
|
||||||
set -gx SCROLLBACK_HISTORY_MAX_FILES 100
|
set -gx SCROLLBACK_HISTORY_MAX_FILES 100
|
||||||
# Wire up a clean exit function that won't fire on background subshells
|
# 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'
|
function exit --description 'Safe interactive exit'
|
||||||
# If the smart_exit file exists in our function path, invoke it explicitly
|
# If the smart_exit file exists in our function path, invoke it explicitly
|
||||||
if functions -q smart_exit
|
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,
|
# Additionally, directories inside the CWD will still take precedence over CDPATH,
|
||||||
# so if you have a directory named 'myproject' in the current directory,
|
# so if you have a directory named 'myproject' in the current directory,
|
||||||
# running 'cd myproject' will take you there instead of $HOME/projects/myproject.
|
# 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 ──────────────────────────
|
# ──────────────────────────── Bootstrap Fisher ──────────────────────────
|
||||||
# Fisher is bootstrapped automatically on first run via conf.d/first_run.fish
|
# Fisher is bootstrapped automatically on first run via conf.d/first_run.fish
|
||||||
@@ -123,7 +171,11 @@ if status is-interactive
|
|||||||
# ────────────────────────────── Key bindings ────────────────────────────
|
# ────────────────────────────── Key bindings ────────────────────────────
|
||||||
# Helps ensure that key bindings are consistent with the Vi editing mode set below.
|
# 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.
|
# 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 ────────────────────────
|
# ──────────────────────── Source FZF integration ────────────────────────
|
||||||
# Prefer fzf's own fish integration (fzf --fish, available since fzf 0.48)
|
# Prefer fzf's own fish integration (fzf --fish, available since fzf 0.48)
|
||||||
|
|||||||
@@ -162,6 +162,11 @@ local=## Machine-local Configuration
|
|||||||
secrets=## Secrets and API Keys
|
secrets=## Secrets and API Keys
|
||||||
overrides=## Overriding Configuration Variables
|
overrides=## Overriding Configuration Variables
|
||||||
universal=## Fish Universal 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 ─────────────────────────────────
|
# ── Section 8: Fisher Plugins ─────────────────────────────────
|
||||||
plugins=# 8. FISHER PLUGINS
|
plugins=# 8. FISHER PLUGINS
|
||||||
|
|||||||
@@ -156,6 +156,10 @@ automatically on exit. Use `logs` to browse them interactively.
|
|||||||
CLAUDE_CODE_NO_FLICKER 1 — suppress terminal flicker in Claude Code
|
CLAUDE_CODE_NO_FLICKER 1 — suppress terminal flicker in Claude Code
|
||||||
CDPATH . ~/projects ~
|
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 Hierarchy
|
||||||
|
|
||||||
$PAGER is set to ov when available, falling back to less. The less wrapper
|
$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
|
`set -U`. These are machine-local and git-ignored. Do not commit
|
||||||
fish_variables.
|
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
|
## Prompt and Theme
|
||||||
|
|
||||||
### Starship
|
### Starship
|
||||||
|
|||||||
@@ -14,7 +14,10 @@
|
|||||||
# cd ~/myproject # activates .venv if present
|
# cd ~/myproject # activates .venv if present
|
||||||
function __auto_source_fallback_venv --on-variable PWD
|
function __auto_source_fallback_venv --on-variable PWD
|
||||||
status --is-command-substitution; and return
|
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
|
# 1. Skip if direnv is already managing this directory
|
||||||
if set -q DIRENV_DIR; or test -e ".envrc"
|
if set -q DIRENV_DIR; or test -e ".envrc"
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -14,6 +14,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# bash
|
# bash
|
||||||
function bash --wraps='bash' --description 'bash switches to bash shell'
|
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
|
set SHELL $(which bash) # Set shell to bash
|
||||||
command bash --rcfile "$XDG_CONFIG_HOME/bash/bashrc" $argv # Run bash
|
command bash --rcfile "$XDG_CONFIG_HOME/bash/bashrc" $argv # Run bash
|
||||||
set SHELL $(which fish) # Reset shell
|
set SHELL $(which fish) # Reset shell
|
||||||
|
|||||||
+7
-1
@@ -15,7 +15,13 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# cat README.md
|
# cat README.md
|
||||||
function cat --wraps='bat' --description 'Use bat for files, ls for directories, and raw cat for ANSI logs'
|
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.
|
# We'll maintain that behavior by skipping the directory check if $argv is empty.
|
||||||
if set -q argv[1]
|
if set -q argv[1]
|
||||||
if test -d $argv[1]
|
if test -d $argv[1]
|
||||||
|
|||||||
@@ -18,6 +18,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# du ~/Downloads
|
# du ~/Downloads
|
||||||
function du --description 'Execute du'
|
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 cmd ""
|
||||||
set args
|
set args
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Execute expand_bang_all
|
# Execute expand_bang_all
|
||||||
function expand_bang_all --description '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]
|
set -l token $argv[1]
|
||||||
if test -z "$token"; set token (commandline -t); end
|
if test -z "$token"; set token (commandline -t); end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Execute expand_bang_caret
|
# Execute expand_bang_caret
|
||||||
function expand_bang_caret --description '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
|
# Split the last history item into a list
|
||||||
set -l tokens (string split -n ' ' -- $history[1])
|
set -l tokens (string split -n ' ' -- $history[1])
|
||||||
# tokens[1] is the command, tokens[2] is the first argument
|
# tokens[1] is the command, tokens[2] is the first argument
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Execute expand_bang_minus_n
|
# Execute expand_bang_minus_n
|
||||||
function expand_bang_minus_n --description '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]
|
set -l token $argv[1]
|
||||||
if test -z "$token"; set token (commandline -t); end
|
if test -z "$token"; set token (commandline -t); end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Execute expand_bang_search
|
# Execute expand_bang_search
|
||||||
function expand_bang_search --description '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]
|
set -l token $argv[1]
|
||||||
if test -z "$token"
|
if test -z "$token"
|
||||||
set token (commandline -t)
|
set token (commandline -t)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Execute expand_bang_string
|
# Execute expand_bang_string
|
||||||
function expand_bang_string --description '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]
|
# Fish 4.x passes the matched token as argv[1]
|
||||||
set -l token $argv[1]
|
set -l token $argv[1]
|
||||||
if test -z "$token"
|
if test -z "$token"
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Execute expand_typo_sub
|
# Execute expand_typo_sub
|
||||||
function expand_typo_sub --description '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.
|
# if the abbr is set up correctly. We'll fallback to commandline just in case.
|
||||||
set -l last_cmd $history[1]
|
set -l last_cmd $history[1]
|
||||||
set -l current_token $argv[1]
|
set -l current_token $argv[1]
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# # Rendered automatically by Fish shell; not called directly.
|
# # Rendered automatically by Fish shell; not called directly.
|
||||||
function fish_right_prompt --description 'Execute fish_right_prompt'
|
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
|
# 1. Docker Context in Blue
|
||||||
set -l docker_ctx (docker context show 2>/dev/null)
|
set -l docker_ctx (docker context show 2>/dev/null)
|
||||||
if test -n "$docker_ctx"; and test "$docker_ctx" != default
|
if test -n "$docker_ctx"; and test "$docker_ctx" != default
|
||||||
|
|||||||
@@ -66,6 +66,12 @@ end
|
|||||||
|
|
||||||
# --- Wrapper Definition ---
|
# --- Wrapper Definition ---
|
||||||
function help --wraps help --description "Custom wrapper to intercept 'help config'"
|
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
|
if test "$argv[1]" = config
|
||||||
# All arguments after 'config' — including flags (-w/--html, -m/--man,
|
# All arguments after 'config' — including flags (-w/--html, -m/--man,
|
||||||
# -h/--help) and section keywords — are forwarded to config-help.
|
# -h/--help) and section keywords — are forwarded to config-help.
|
||||||
|
|||||||
@@ -11,6 +11,14 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# hist
|
# hist
|
||||||
function hist --description 'Search fish history and put it in the prompt'
|
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..)
|
set -l selected (history | fzf --reverse --height 40% --with-nth 3..)
|
||||||
|
|
||||||
if test -n "$selected"
|
if test -n "$selected"
|
||||||
|
|||||||
@@ -14,6 +14,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# less /var/log/syslog
|
# less /var/log/syslog
|
||||||
function less --wraps='ov' --description 'Pager wrapper: $PAGER → ov → less → more → cat'
|
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
|
if set -q PAGER; and command -q $PAGER
|
||||||
command $PAGER $argv
|
command $PAGER $argv
|
||||||
else if command -q ov
|
else if command -q ov
|
||||||
|
|||||||
@@ -19,6 +19,14 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# logs -c paru
|
# logs -c paru
|
||||||
function logs --description 'Browse terminal log files interactively with fzf'
|
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=
|
set -l options h/help c/category=
|
||||||
argparse $options -- $argv
|
argparse $options -- $argv
|
||||||
or return 1
|
or return 1
|
||||||
|
|||||||
@@ -14,6 +14,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# ls ~/projects
|
# ls ~/projects
|
||||||
function ls --description 'List all files'
|
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
|
if which eza >/dev/null 2>&1
|
||||||
eza -l -a --icons --color=auto --hyperlink $argv
|
eza -l -a --icons --color=auto --hyperlink $argv
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# mkdir ~/projects/myapp/src
|
# mkdir ~/projects/myapp/src
|
||||||
function mkdir --description 'Execute mkdir'
|
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
|
if status is-interactive
|
||||||
# Fall back to command mkdir -p when flags are present (e.g. -m 755)
|
# Fall back to command mkdir -p when flags are present (e.g. -m 755)
|
||||||
for _arg in $argv
|
for _arg in $argv
|
||||||
|
|||||||
@@ -17,6 +17,12 @@
|
|||||||
# ping google.com
|
# ping google.com
|
||||||
# ping --legend google.com
|
# ping --legend google.com
|
||||||
function ping --description 'prettyping with default nolegend'
|
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
|
if command -q prettyping
|
||||||
# Check if the user specifically asked for the legend
|
# Check if the user specifically asked for the legend
|
||||||
if contains -- --legend $argv
|
if contains -- --legend $argv
|
||||||
|
|||||||
@@ -15,6 +15,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# rg "TODO" src/
|
# rg "TODO" src/
|
||||||
function rg --description 'alias rg=rg --hyperlink-format=kitty'
|
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
|
if test "$TERM" = xterm-kitty
|
||||||
command rg --hyperlink-format=kitty $argv
|
command rg --hyperlink-format=kitty $argv
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
# deletes via rm -rf and triggers fstrim. Plain paths and -r/-R are sent
|
# 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.
|
# 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
|
# ARGUMENTS
|
||||||
# (none) List current trash contents
|
# (none) List current trash contents
|
||||||
# -e, --empty [opts] Empty the trash; opts forwarded to trash empty
|
# -e, --empty [opts] Empty the trash; opts forwarded to trash empty
|
||||||
@@ -27,6 +31,12 @@
|
|||||||
# rm -e
|
# rm -e
|
||||||
# rm -S sensitive_key.pem
|
# rm -S sensitive_key.pem
|
||||||
function rm --description 'Ultimate rm: trash, list, empty, and secure-erase'
|
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)
|
# 1. No arguments: Show the Trash contents (Quick view)
|
||||||
if not set -q argv[1]
|
if not set -q argv[1]
|
||||||
if type -q trash
|
if type -q trash
|
||||||
|
|||||||
@@ -20,6 +20,13 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# smart_exit --no-log
|
# smart_exit --no-log
|
||||||
function smart_exit --description 'Capture colorized scrollback before exiting, with pruning and safe overrides'
|
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
|
set -l options h/help n/no-log
|
||||||
argparse $options -- $argv
|
argparse $options -- $argv
|
||||||
or return 1
|
or return 1
|
||||||
|
|||||||
@@ -23,6 +23,14 @@
|
|||||||
# split
|
# split
|
||||||
# split -v nvim README.md
|
# split -v nvim README.md
|
||||||
function split --description 'Run a command in a new terminal split'
|
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_kitty 0
|
||||||
set -l is_wezterm 0
|
set -l is_wezterm 0
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,14 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# spwin
|
# spwin
|
||||||
function spwin --wraps='~/.config/kitty/spawn-window.sh' --description 'spawn window in kitty or wezterm'
|
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 "$TERM" = xterm-kitty
|
||||||
if test -x ~/.config/kitty/spawn-window.sh
|
if test -x ~/.config/kitty/spawn-window.sh
|
||||||
~/.config/kitty/spawn-window.sh $argv
|
~/.config/kitty/spawn-window.sh $argv
|
||||||
|
|||||||
@@ -15,6 +15,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# ssh user@host
|
# ssh user@host
|
||||||
function ssh --description 'Alias ssh to kitten ssh when using Kitty terminal'
|
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
|
if test "$TERM" = xterm-kitty
|
||||||
kitten ssh $argv
|
kitten ssh $argv
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -19,6 +19,14 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# tab
|
# tab
|
||||||
function tab --description 'Spawn a new tab in the current terminal'
|
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"
|
set -l dir "$cdto"
|
||||||
if test -z "$dir"
|
if test -z "$dir"
|
||||||
set dir "$PWD"
|
set dir "$PWD"
|
||||||
|
|||||||
@@ -14,6 +14,12 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# top
|
# top
|
||||||
function top --wraps='btop' --description 'Use btop as a modern replacement for 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
|
# 1. Check if btop is actually installed
|
||||||
if type -q btop
|
if type -q btop
|
||||||
# 2. Launch btop with any arguments passed
|
# 2. Launch btop with any arguments passed
|
||||||
|
|||||||
@@ -15,6 +15,14 @@
|
|||||||
# EXAMPLE
|
# EXAMPLE
|
||||||
# upgrade
|
# upgrade
|
||||||
function upgrade --description 'Full system upgrade via paru or yay'
|
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 ""
|
set -l aur ""
|
||||||
if type -q paru
|
if type -q paru
|
||||||
set aur paru
|
set aur paru
|
||||||
|
|||||||
Reference in New Issue
Block a user