feat: harden terminal abbreviations, gracefully fallback missing integrations, and check deps #5

Merged
rootiest merged 3 commits from feat/deps-fallbacks into main 2026-05-01 01:18:20 +00:00
8 changed files with 236 additions and 107 deletions
Showing only changes of commit a39df3c466 - Show all commits
+4 -4
View File
@@ -103,7 +103,7 @@ See [FZF Bindings](#fzf-bindings) under Key Bindings for the default FZF shortcu
## Integrations
> **Note:** All integrations listed below are designed to elegantly fallback to basic commands or safely ignore their configuration if their required external dependencies are not installed on the system.
> **Note:** All integrations listed below are designed to gracefully fallback to basic commands or safely ignore their configuration if their required external dependencies are not installed on the system.
### Zoxide
@@ -388,9 +388,9 @@ These abbreviations replicate Bash's bang-style history expansions. They expand
| `cmf` | `chezmoi forget` |
| `cmi` | `chezmoi init` |
### Kitty Window Management
### Kitty / WezTerm Window Management
These abbreviations mirror Vim/tmux ergonomics for managing Kitty splits, tabs, and windows.
These abbreviations mirror Vim/tmux ergonomics for managing terminal splits, tabs, and windows. They automatically detect whether you are using Kitty or WezTerm and execute the appropriate terminal CLI commands.
| Abbr | Action |
|---|---|
@@ -479,7 +479,7 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
| [lazygit](https://github.com/jesseduffield/lazygit) | git TUI |
| [lazydocker](https://github.com/jesseduffield/lazydocker) | Docker TUI |
| [trash-cli](https://github.com/andreafrancia/trash-cli) | Safe `rm` |
| [Kitty](https://sw.kovidgoyal.net/kitty/) | Terminal emulator |
| [Kitty](https://sw.kovidgoyal.net/kitty/) / [WezTerm](https://wezfurlong.org/wezterm/) | Terminal emulator |
| [WakaTime](https://wakatime.com/) | Activity tracking |
---
+108 -46
View File
@@ -19,16 +19,24 @@ abbr -a v antigravity
# Kate
abbr -a k kate
# WezTerm SSH
if test "$TERM_PROGRAM" = WezTerm
abbr -a s wezterm ssh
end
# Neovim in a new tab
#abbr -a editt wezterm cli spawn nvim # WezTerm
if test "$TERM" = xterm-kitty
abbr -a editt kitty @ launch --type=tab --cwd=current nvim # Kitty
end
if test "$TERM_PROGRAM" = WezTerm
abbr -a editt wezterm cli spawn nvim # WezTerm
end
# LazyGit
abbr -a lg lazygit
# Sudo shell
abbr -a sudu sudo -s
# Kitty
if test "$TERM" = xterm-kitty
abbr -a kt kitty
end
# cat
abbr -a c cat
# chezmoi
@@ -65,10 +73,14 @@ abbr -a g git
abbr -a ag antigravity
abbr -a ag. antigravity .
# Quit
# abbr -a :q wezterm cli kill-pane # WezTerm
# abbr -a :Q wezterm cli kill-pane # WezTerm
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
######### Alternates ##########
### ls alternates
@@ -86,116 +98,162 @@ abbr -a lT lt
abbr -a lsT lstree
# Window Creation (OS Windows)
# abbr -a :w wezterm cli spawn --new-window # WezTerm
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)
# abbr -a :wv wezterm cli split-pane --bottom # WezTerm
if test "$TERM" = xterm-kitty
abbr -a :wv kitty @ launch --location=hsplit # Kitty (Horizontal split)
# abbr -a :wh wezterm cli split-pane --right # WezTerm
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)
# abbr -a :wo wezterm cli move-pane-to-new-tab --new-window # WezTerm
if test "$TERM" = xterm-kitty
abbr -a :wo kitty @ detach-window --target-tab=new # Kitty (Moves pane to new tab)
# abbr -a :wot wezterm cli move-pane-to-new-tab # WezTerm
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
# abbr -a :t wezterm cli spawn # WezTerm
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
# abbr -a :tl wezterm cli set-tab-title # WezTerm
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
# abbr -a :tw wezterm cli set-window-title # WezTerm
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
# abbr -a :twk wezterm cli rename-workspace # WezTerm
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
# abbr -a :tp wezterm cli activate-tab --tab-relative -1 # WezTerm
if test "$TERM" = xterm-kitty
abbr -a :tp "kitty @ focus-tab --match neighbor:left" # Kitty
# abbr -a :tn wezterm cli activate-tab --tab-relative 1 # WezTerm
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)
# abbr -a :tgk wezterm cli spawn --cwd ~/.config/kitty # WezTerm
if test "$TERM" = xterm-kitty
abbr -a :tgk kitty @ launch --type=tab --cwd ~/.config/kitty # Kitty
# abbr -a :tgn wezterm cli spawn --cwd ~/.config/nvim # WezTerm
abbr -a :tgn kitty @ launch --type=tab --cwd ~/.config/nvim # Kitty
# abbr -a :tgf wezterm cli spawn --cwd ~/.config/fish # WezTerm
abbr -a :tgf kitty @ launch --type=tab --cwd ~/.config/fish # Kitty
# abbr -a :tgh wezterm cli spawn --cwd ~ # WezTerm
abbr -a :tgh kitty @ launch --type=tab --cwd ~
# abbr -a :tgcz wezterm cli spawn --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :tgcz kitty @ launch --type=tab --cwd ~/.local/share/chezmoi # Kitty
# abbr -a :tgcm wezterm cli spawn --cwd ~/.config/chezmoi # WezTerm
abbr -a :tgcm kitty @ launch --type=tab --cwd ~/.config/chezmoi # Kitty
# abbr -a :tgp wezterm cli spawn --cwd ~/projects # WezTerm
abbr -a :tgp kitty @ launch --type=tab --cwd ~/projects # Kitty
# abbr -a :tgr wezterm cli spawn -- sudo -i # WezTerm
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)
# abbr -a :wgk wezterm cli spawn --new-window --cwd ~/.config/kitty # WezTerm
if test "$TERM" = xterm-kitty
abbr -a :wgk kitty @ launch --type=os-window --cwd ~/.config/kitty # Kitty
# abbr -a :wgn wezterm cli spawn --new-window --cwd ~/.config/nvim # WezTerm
abbr -a :wgn kitty @ launch --type=os-window --cwd ~/.config/nvim # Kitty
# abbr -a :wgf wezterm cli spawn --new-window --cwd ~/.config/fish # WezTerm
abbr -a :wgf kitty @ launch --type=os-window --cwd ~/.config/fish # Kitty
# abbr -a :wgh wezterm cli spawn --new-window --cwd ~ # WezTerm
abbr -a :wgh kitty @ launch --type=os-window --cwd ~
# abbr -a :wgzd wezterm cli spawn --new-window --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :wgzd kitty @ launch --type=os-window --cwd ~/.local/share/chezmoi # Kitty
# abbr -a :wgcz wezterm cli spawn --new-window --cwd ~/.config/chezmoi # WezTerm
abbr -a :wgcz kitty @ launch --type=os-window --cwd ~/.config/chezmoi # Kitty
# abbr -a :wgp wezterm cli spawn --new-window --cwd ~/projects # WezTerm
abbr -a :wgp kitty @ launch --type=os-window --cwd ~/projects # Kitty
# abbr -a :wgr wezterm cli spawn --new-window -- sudo -i # WezTerm
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)
# abbr -a :wvgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # WezTerm
if test "$TERM" = xterm-kitty
abbr -a :wvgk kitty @ launch --location=hsplit --cwd ~/.config/kitty # Kitty
# abbr -a :wvgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
abbr -a :wvgn kitty @ launch --location=hsplit --cwd ~/.config/nvim # Kitty
# abbr -a :wvgf wezterm cli split-pane --bottom --cwd ~/.config/fish # WezTerm
abbr -a :wvgf kitty @ launch --location=hsplit --cwd ~/.config/fish # Kitty
# abbr -a :wvgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
abbr -a :wvgh kitty @ launch --location=hsplit --cwd ~ # Kitty
# abbr -a :wvgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :wvgcz kitty @ launch --location=hsplit --cwd ~/.local/share/chezmoi # Kitty
# abbr -a :wvgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
abbr -a :wvgcm kitty @ launch --location=hsplit --cwd ~/.config/chezmoi # Kitty
# abbr -a :wvgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
abbr -a :wvgp kitty @ launch --location=hsplit --cwd ~/projects # Kitty
# abbr -a :wvgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
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)
# abbr -a :whgk wezterm cli split-pane --bottom --cwd ~/.config/kitty # WezTerm
if test "$TERM" = xterm-kitty
abbr -a :whgk kitty @ launch --location=vsplit --cwd ~/.config/kitty # Kitty
# abbr -a :whgn wezterm cli split-pane --bottom --cwd ~/.config/nvim # WezTerm
abbr -a :whgn kitty @ launch --location=vsplit --cwd ~/.config/nvim # Kitty
# abbr -a :whgf wezterm cli split-pane --bottom --cwd ~/.config/fish # WezTerm
abbr -a :whgf kitty @ launch --location=vsplit --cwd ~/.config/fish # Kitty
# abbr -a :whgh wezterm cli split-pane --bottom --cwd ~ # WezTerm
abbr -a :whgh kitty @ launch --location=vsplit --cwd ~ # Kitty
# abbr -a :whgcz wezterm cli split-pane --bottom --cwd ~/.local/share/chezmoi # WezTerm
abbr -a :whgcz kitty @ launch --location=vsplit --cwd ~/.local/share/chezmoi # Kitty
# abbr -a :whgcm wezterm cli split-pane --bottom --cwd ~/.config/chezmoi # WezTerm
abbr -a :whgcm kitty @ launch --location=vsplit --cwd ~/.config/chezmoi # Kitty
# abbr -a :whgp wezterm cli split-pane --bottom --cwd ~/projects # WezTerm
abbr -a :whgp kitty @ launch --location=vsplit --cwd ~/projects # Kitty
# abbr -a :whgr wezterm cli split-pane --bottom -- sudo -i # WezTerm
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'
@@ -211,9 +269,13 @@ abbr -a :cdp --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
### Docker ###
abbr -a dcl 'docker context use default # Local Host'
+49
View File
@@ -0,0 +1,49 @@
# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
function check_fish_deps --description "Check all fish-related dependencies"
set -l required fish fisher starship fzf zoxide direnv paru
set -l integrations wakatime tailscale
set -l recommended eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
function __print_dep
set -l dep $argv[1]
if type -q $dep
set_color green
echo -n "  "
set_color normal
echo -n "$dep "
set_color brblack
echo "(Found at "(type -p $dep)")"
set_color normal
else
set_color red
echo -n "  "
set_color normal
echo -n "$dep "
set_color brblack
echo "(Not installed)"
set_color normal
end
end
set_color cyan; echo "Required Dependencies:"; set_color normal
for dep in $required
__print_dep $dep
end
echo ""
set_color cyan; echo "Integrations:"; set_color normal
for dep in $integrations
__print_dep $dep
end
echo ""
set_color cyan; echo "Recommended Dependencies:"; set_color normal
for dep in $recommended
__print_dep $dep
end
echo ""
functions -e __print_dep
end
+5 -2
View File
@@ -2,6 +2,9 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
function clone --wraps=clone-in-kitty --description 'alias clone=clone-in-kitty'
clone-in-kitty $argv
if test "$TERM" != xterm-kitty
echo "Error: The 'clone' command requires Kitty terminal." >&2
return 1
end
clone-in-kitty $argv
end
+5 -2
View File
@@ -2,6 +2,9 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
function clonet --wraps='clone-in-kitty --type=tab' --description 'alias clonet=clone-in-kitty --type=tab'
clone-in-kitty --type=tab $argv
if test "$TERM" != xterm-kitty
echo "Error: The 'clonet' command requires Kitty terminal." >&2
return 1
end
clone-in-kitty --type=tab $argv
end
+4 -1
View File
@@ -2,6 +2,9 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
function rg --description 'alias rg=rg --hyperlink-format=kitty'
if test "$TERM" = xterm-kitty
command rg --hyperlink-format=kitty $argv
else
command rg $argv
end
end
+5
View File
@@ -2,6 +2,11 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
function split --description 'Run a command in a new Kitty split'
if test "$TERM" != xterm-kitty
echo "Error: The 'split' command requires Kitty terminal." >&2
return 1
end
set -l location hsplit
switch $argv[1]
+4
View File
@@ -2,5 +2,9 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
function spwin --wraps='~/.config/kitty/spawn-window.sh' --description 'alias spwin=~/.config/kitty/spawn-window.sh'
if test "$TERM" != xterm-kitty
echo "Error: The 'spwin' command requires Kitty terminal." >&2
return 1
end
~/.config/kitty/spawn-window.sh $argv
end