Compare commits
34 Commits
d2e7c799c4
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e766b3326 | |||
|
a7510cc8ea
|
|||
|
a351e62a17
|
|||
|
7936a0966e
|
|||
|
fee2d99bea
|
|||
|
7d4e33bc7e
|
|||
|
782ef833c2
|
|||
|
8917442089
|
|||
|
8d9e7ae43f
|
|||
|
9e7539d863
|
|||
|
6fd1e3221e
|
|||
|
df7c921bc6
|
|||
|
abbbf20b40
|
|||
|
a70e88c344
|
|||
|
a7c6b9097d
|
|||
|
0e7e824085
|
|||
|
a3d99eec3f
|
|||
|
a86f797627
|
|||
|
1a6f1f3f2c
|
|||
|
b82766ad52
|
|||
|
9b342114aa
|
|||
|
f09006846b
|
|||
|
2df665a537
|
|||
|
46be262f92
|
|||
| a442315312 | |||
|
6530935652
|
|||
|
bdbdf2e8e0
|
|||
|
d7471e2eca
|
|||
|
7acd099b3e
|
|||
|
e502cff8cb
|
|||
| 50979acc1f | |||
|
4aea2f4e2c
|
|||
| be051daf1e | |||
|
05139354cf
|
@@ -241,6 +241,24 @@ rm -f file.txt # Falls through to standard rm -f
|
||||
| `upgrade` | Full system upgrade: `paru -Syu --noconfirm` |
|
||||
| `cleanup` | Log and remove orphaned packages |
|
||||
|
||||
### Dependency Management
|
||||
|
||||
`fish-deps` is a unified command for checking, installing, and updating all tools this config depends on.
|
||||
|
||||
| Command | Description |
|
||||
|---|---|
|
||||
| `fish-deps` / `fish-deps status` | Show installed/missing status for all deps, grouped by tier |
|
||||
| `fish-deps install` | Interactively install each missing dep (prompts per-dep, prompts method when multiple exist) |
|
||||
| `fish-deps update` | Update all installed deps using their preferred install method |
|
||||
| `fish-deps sync` | Install missing deps then update installed ones |
|
||||
| `fzf-update` | Install or upgrade fzf from git HEAD into `~/.fzf` (guarantees the latest build) |
|
||||
| `check_fish_deps` | Legacy alias — delegates to `fish-deps status` |
|
||||
|
||||
Install method priority: **git+cargo source build** (fish) → **cargo** (other Rust tools, gets latest crate) → **system PM** (paru/apt/brew/etc.) → **git clone** (fzf) → **curl installer** (starship, fisher) → **pipx** (Python tools). When multiple methods are available for a tool, you are prompted to choose.
|
||||
|
||||
> [!NOTE]
|
||||
> Upgrading Fish from source requires **cargo** and **[uv](https://docs.astral.sh/uv/)**. Both are managed dependencies — `fish-deps install` will offer to install them before attempting the Fish build. If both are unavailable, `fish-deps update` falls back to the system package manager.
|
||||
|
||||
### Docker
|
||||
|
||||
| Function | Description |
|
||||
@@ -476,20 +494,27 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
|
||||
|
||||
### Required
|
||||
|
||||
| Tool | Purpose |
|
||||
|---|---|
|
||||
| [Fish](https://fishshell.com/) | Shell |
|
||||
| [Fisher](https://github.com/jorgebucaran/fisher) | Plugin manager |
|
||||
| [Starship](https://starship.rs/) | Prompt |
|
||||
| [fzf](https://github.com/junegunn/fzf) | Fuzzy finder |
|
||||
| [zoxide](https://github.com/ajeetdsouza/zoxide) | Smart directory jumper |
|
||||
| [direnv](https://direnv.net/) | Per-directory env loading |
|
||||
| [paru](https://github.com/Morganamilo/paru) | AUR helper |
|
||||
| Tool | Version | Purpose |
|
||||
|---|---|---|
|
||||
| [uv](https://docs.astral.sh/uv/) | any | Python runner (needed to build Fish from source) |
|
||||
| [Rust / cargo](https://www.rust-lang.org/tools/install) | any | Installs Rust-based tools; required to build Fish |
|
||||
| [Fish](https://fishshell.com/) | **≥ 4.0** | Shell |
|
||||
| [Fisher](https://github.com/jorgebucaran/fisher) | any | Plugin manager |
|
||||
| [Starship](https://starship.rs/) | any | Prompt |
|
||||
| [fzf](https://github.com/junegunn/fzf) | any | Fuzzy finder |
|
||||
| [zoxide](https://github.com/ajeetdsouza/zoxide) | any | Smart directory jumper |
|
||||
| [direnv](https://direnv.net/) | any | Per-directory env loading |
|
||||
|
||||
> [!WARNING]
|
||||
> Fish **4.0 or newer is required.** This config uses `test` syntax and other constructs that are incompatible with Fish 3.x. Older versions will produce errors on startup.
|
||||
> Run `fish-deps install` or `fish-deps update` to upgrade — it will install `uv` and `cargo` automatically if missing, then build the latest Fish from source.
|
||||
|
||||
### Recommended
|
||||
|
||||
| Tool | Replaces |
|
||||
|---|---|
|
||||
| [Rust / cargo](https://www.rust-lang.org/tools/install) | Build tool for Rust-based CLI replacements below |
|
||||
| [paru](https://github.com/Morganamilo/paru) / [yay](https://github.com/Jguer/yay) | AUR helper (Arch only) |
|
||||
| [eza](https://github.com/eza-community/eza) | `ls` (preferred) |
|
||||
| [lsd](https://github.com/lsd-rs/lsd) | `ls` (fallback) |
|
||||
| [bat](https://github.com/sharkdp/bat) | `cat` |
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@ end
|
||||
# This variable is global so that it can be referenced by fzf_configure_bindings and in tests
|
||||
set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)'
|
||||
|
||||
# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
|
||||
# Install the default bindings only if fzf is available
|
||||
type -q fzf || exit
|
||||
fzf_configure_bindings
|
||||
|
||||
# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased
|
||||
|
||||
@@ -52,7 +52,7 @@ function fish_user_key_bindings
|
||||
bind ctrl-g __insert_previous_path_head
|
||||
bind ctrl-f __interactive_history_sub
|
||||
bind ctrl-alt-u _replace_command_token
|
||||
bind ctrl-alt-= _qalc_eval
|
||||
type -q qalc && bind ctrl-alt-= _qalc_eval
|
||||
bind ctrl-enter _smart_execute
|
||||
|
||||
# Set bindings for all Vi modes:
|
||||
@@ -61,7 +61,7 @@ function fish_user_key_bindings
|
||||
bind --mode $mode ctrl-g __insert_previous_path_head
|
||||
bind --mode $mode ctrl-f __interactive_history_sub
|
||||
bind --mode $mode ctrl-alt-u _replace_command_token
|
||||
bind --mode $mode ctrl-alt-= _qalc_eval
|
||||
type -q qalc && bind --mode $mode ctrl-alt-= _qalc_eval
|
||||
bind --mode $mode ctrl-enter _smart_execute
|
||||
end
|
||||
end
|
||||
|
||||
+17
-2
@@ -33,13 +33,28 @@ if status is-interactive
|
||||
_zoxide_cd $HOME
|
||||
else if test "$argv" = -
|
||||
_zoxide_cd -
|
||||
else if test -d $argv[-1]
|
||||
else
|
||||
# Check if the argument is a directory (respecting CDPATH)
|
||||
set -l is_dir 1
|
||||
if test -d $argv[-1]
|
||||
set is_dir 0
|
||||
else if not string match -rq '^\.?\.?/' -- $argv[-1]
|
||||
for i in $CDPATH
|
||||
if test -n "$i" -a -d "$i/$argv[-1]"
|
||||
set is_dir 0
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if test $is_dir -eq 0
|
||||
_zoxide_cd $argv[-1]
|
||||
else
|
||||
set -l result (command zoxide query $argv)
|
||||
set -l result (command zoxide query -- $argv)
|
||||
and _zoxide_cd $result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function zi
|
||||
set -l result (command zoxide query -i -- $argv)
|
||||
|
||||
+21
-4
@@ -74,6 +74,8 @@ fish_add_path -mg --move $CARGO_HOME/bin
|
||||
fish_add_path $BUN_INSTALL/bin
|
||||
fish_add_path $XDG_DATA_HOME/npm-global/bin
|
||||
fish_add_path $HOME/.lmstudio/bin
|
||||
fish_add_path $HOME/.resend/bin
|
||||
fish_add_path $HOME/.fzf/bin
|
||||
|
||||
# ───────────────────────── CDPATH projects dir ──────────────────────────
|
||||
# Allows cd-ing to directories within $HOME/projects or $HOME without needing to specify the full path.
|
||||
@@ -110,10 +112,25 @@ if status is-interactive
|
||||
set -g fish_key_bindings fish_vi_key_bindings
|
||||
|
||||
# ──────────────────────── Source FZF integration ────────────────────────
|
||||
# Sources the FZF integration script, which provides enhanced command history
|
||||
# searching and file finding capabilities.
|
||||
if test -f "$__fish_config_dir/integrations/fzf.fish"
|
||||
source "$__fish_config_dir/integrations/fzf.fish"
|
||||
# Prefer fzf's own fish integration (fzf --fish, available since fzf 0.48)
|
||||
# which is always version-matched to the installed binary. Fall back to our
|
||||
# bundled integrations/fzf.fish for older builds.
|
||||
# Run `fzf-update` to install/upgrade fzf from git HEAD.
|
||||
if type -q fzf
|
||||
set -l _fzf_minor (fzf --version | string match -r '^\d+\.(\d+)')[2]
|
||||
if test -n "$_fzf_minor" -a "$_fzf_minor" -ge 48
|
||||
fzf --fish | source
|
||||
else
|
||||
test -f "$__fish_config_dir/integrations/fzf.fish"
|
||||
and source "$__fish_config_dir/integrations/fzf.fish"
|
||||
end
|
||||
else
|
||||
# conf.d/fzf.fish is managed by Fisher and may be restored on fisher
|
||||
# update, so this is the reliable place to strip its bindings when
|
||||
# fzf is not installed.
|
||||
if functions -q _fzf_uninstall_bindings
|
||||
_fzf_uninstall_bindings
|
||||
end
|
||||
end
|
||||
|
||||
# ──────────────────────────────── DirENV ────────────────────────────────
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Populates parallel arrays describing every managed dependency.
|
||||
# Callers must invoke this function before accessing _fdc_* arrays.
|
||||
#
|
||||
# Array layout (same index across all sets):
|
||||
# _fdc_bins — binary name (what `type -q` checks)
|
||||
# _fdc_tiers — req | int | rec
|
||||
# _fdc_cargo — cargo crate name, or "" if not on crates.io
|
||||
# _fdc_pm — system PM package name, or "" if not in repos
|
||||
# _fdc_special — special install key: rustup-installer | fisher-bootstrap |
|
||||
# fzf-update | paru-build | pipx | curl-installer |
|
||||
# git-cargo-fish | curl-uv | "" (none)
|
||||
#
|
||||
# uv and cargo are listed first so both are available before fish and other Rust tools.
|
||||
function _fish_deps_catalog
|
||||
set -g _fdc_bins \
|
||||
uv cargo fish fisher starship fzf zoxide direnv paru \
|
||||
wakatime tailscale \
|
||||
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
|
||||
|
||||
set -g _fdc_tiers \
|
||||
req req req req req req req req rec \
|
||||
int int \
|
||||
rec rec rec rec rec rec rec rec rec rec rec rec rec rec
|
||||
|
||||
set -g _fdc_cargo \
|
||||
"" "" "" "" starship "" zoxide "" "" \
|
||||
"" "" \
|
||||
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trashy "" ""
|
||||
|
||||
set -g _fdc_pm \
|
||||
uv cargo fish "" starship fzf zoxide direnv "" \
|
||||
wakatime tailscale \
|
||||
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
|
||||
|
||||
set -g _fdc_special \
|
||||
curl-uv rustup-installer git-cargo-fish fisher-bootstrap curl-installer fzf-update "" "" paru-build \
|
||||
wakatime-binary "" \
|
||||
"" "" "" "" "" "" "" "" "" "" curl-lazydocker "" "" ""
|
||||
end
|
||||
|
||||
# Returns the index (1-based) of $argv[1] in the catalog, or "" if not found.
|
||||
function _fish_deps_catalog_idx --argument-names bin
|
||||
_fish_deps_catalog
|
||||
set -l i 1
|
||||
for b in $_fdc_bins
|
||||
if test "$b" = "$bin"
|
||||
echo $i
|
||||
return
|
||||
end
|
||||
set i (math $i + 1)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Detect the first available system package manager.
|
||||
function _fish_deps_detect_pm
|
||||
for pm in paru yay pacman apt brew pkg dnf yum
|
||||
if type -q $pm
|
||||
echo $pm
|
||||
return
|
||||
end
|
||||
end
|
||||
echo ""
|
||||
end
|
||||
@@ -0,0 +1,265 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Interactively install missing deps.
|
||||
# For each missing dep: prompts yes/no, then prompts install method when multiple exist.
|
||||
function _fish_deps_install
|
||||
_fish_deps_catalog
|
||||
|
||||
set -l pm (_fish_deps_detect_pm)
|
||||
set -l installed_any 0
|
||||
|
||||
set -l i 1
|
||||
for bin in $_fdc_bins
|
||||
# Determine if this dep needs attention: missing, or fish < 4.0
|
||||
set -l needs_install 0
|
||||
set -l upgrade_label Install
|
||||
if not type -q $bin
|
||||
set needs_install 1
|
||||
else if test "$bin" = fish
|
||||
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
|
||||
if test -n "$_major"; and test "$_major" -lt 4
|
||||
set needs_install 1
|
||||
set upgrade_label "Upgrade"
|
||||
end
|
||||
end
|
||||
|
||||
if test $needs_install -eq 1
|
||||
set -l cargo_crate $_fdc_cargo[$i]
|
||||
set -l pm_pkg $_fdc_pm[$i]
|
||||
set -l special $_fdc_special[$i]
|
||||
|
||||
# Build list of available install methods
|
||||
set -l methods
|
||||
set -l method_labels
|
||||
|
||||
# Cargo — preferred for Rust tools; gets the latest crate version
|
||||
if test -n "$cargo_crate"
|
||||
if type -q cargo
|
||||
set -a methods cargo
|
||||
set -a method_labels "cargo ($cargo_crate)"
|
||||
else
|
||||
set_color brblack
|
||||
echo " note: cargo not found — install cargo first for the latest $bin"
|
||||
set_color normal
|
||||
end
|
||||
end
|
||||
|
||||
# Preferred special methods — listed before system PM so they are the default
|
||||
switch $special
|
||||
case curl-uv
|
||||
set -a methods special-uv
|
||||
set -a method_labels "curl installer (official script)"
|
||||
case git-cargo-fish
|
||||
if type -q cargo; and type -q uv
|
||||
set -a methods special-git-cargo-fish
|
||||
set -a method_labels "build from source (git + cargo)"
|
||||
else
|
||||
set_color brblack
|
||||
set -l _need
|
||||
type -q cargo; or set -a _need cargo
|
||||
type -q uv; or set -a _need uv
|
||||
echo " note: "(string join " and " $_need)" not found — install them first to build fish from source"
|
||||
set_color normal
|
||||
end
|
||||
case rustup-installer
|
||||
set -a methods special-rustup
|
||||
set -a method_labels "rustup installer (curl | sh)"
|
||||
case curl-lazydocker
|
||||
set -a methods special-lazydocker
|
||||
set -a method_labels "curl installer (official script)"
|
||||
case wakatime-binary
|
||||
set -a methods special-wakatime
|
||||
set -a method_labels "binary download (github releases)"
|
||||
end
|
||||
|
||||
# System PM — after cargo and preferred specials
|
||||
if test -n "$pm_pkg"; and test -n "$pm"
|
||||
set -a methods pm
|
||||
set -a method_labels "$pm ($pm_pkg)"
|
||||
end
|
||||
|
||||
# Supplemental special methods (fallbacks, Arch-only, etc.)
|
||||
switch $special
|
||||
case fzf-update
|
||||
set -a methods special-fzf
|
||||
set -a method_labels "git clone (~/.fzf)"
|
||||
case fisher-bootstrap
|
||||
set -a methods special-fisher
|
||||
set -a method_labels "curl bootstrap (fisher)"
|
||||
case curl-installer
|
||||
set -a methods special-curl
|
||||
set -a method_labels "curl installer"
|
||||
case paru-build
|
||||
# Only offered on Arch-based systems where pacman is present
|
||||
if type -q yay
|
||||
set -a methods special-yay-paru
|
||||
set -a method_labels "yay -S paru"
|
||||
end
|
||||
if type -q pacman
|
||||
set -a methods special-paru
|
||||
set -a method_labels "build from AUR (makepkg)"
|
||||
end
|
||||
case pipx
|
||||
if type -q pipx
|
||||
set -a methods special-pipx
|
||||
set -a method_labels "pipx ($bin)"
|
||||
else if type -q pip
|
||||
set -a methods special-pip
|
||||
set -a method_labels "pip install --user ($bin)"
|
||||
end
|
||||
end
|
||||
|
||||
if test (count $methods) -eq 0
|
||||
set_color yellow
|
||||
echo " $bin: no install method available on this system — skipping"
|
||||
set_color normal
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# Prompt: install/upgrade this dep?
|
||||
read -l -P (set_color cyan)"$upgrade_label $bin?"(set_color normal)" [Y/n] " _reply
|
||||
if test "$_reply" = n; or test "$_reply" = N
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# Choose install method
|
||||
set -l chosen_method $methods[1]
|
||||
if test (count $methods) -gt 1
|
||||
echo " Available methods:"
|
||||
set -l m 1
|
||||
for lbl in $method_labels
|
||||
set_color brblack; echo -n " $m) "; set_color normal
|
||||
echo $lbl
|
||||
set m (math $m + 1)
|
||||
end
|
||||
read -l -P " Choose [1-"(count $methods)"] (default 1 = $method_labels[1]): " _choice
|
||||
if string match -qr '^\d+$' "$_choice"; and test "$_choice" -ge 1; and test "$_choice" -le (count $methods)
|
||||
set chosen_method $methods[$_choice]
|
||||
end
|
||||
else
|
||||
set_color brblack; echo " "(string lower $upgrade_label)"ing via $method_labels[1]"; set_color normal
|
||||
end
|
||||
|
||||
# Execute chosen method
|
||||
switch $chosen_method
|
||||
case cargo
|
||||
cargo install $cargo_crate
|
||||
case pm
|
||||
_fish_deps_pm_install $pm_pkg
|
||||
case special-rustup
|
||||
curl https://sh.rustup.rs -sSf | sh
|
||||
# Add cargo to PATH for the rest of this session without restarting.
|
||||
# Try CARGO_HOME first (set in config.fish), then the rustup default.
|
||||
for _d in "$CARGO_HOME/bin" "$HOME/.cargo/bin"
|
||||
if test -d "$_d"
|
||||
fish_add_path "$_d"
|
||||
break
|
||||
end
|
||||
end
|
||||
if not type -q cargo
|
||||
set_color yellow
|
||||
echo " cargo not yet in PATH — restart your shell if subsequent installs fail."
|
||||
set_color normal
|
||||
end
|
||||
case special-lazydocker
|
||||
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
|
||||
case special-wakatime
|
||||
set -l _arch (uname -m)
|
||||
switch $_arch
|
||||
case x86_64
|
||||
set _arch amd64
|
||||
case aarch64 arm64
|
||||
set _arch arm64
|
||||
case armv7l
|
||||
set _arch arm
|
||||
case '*'
|
||||
set _arch amd64
|
||||
end
|
||||
set -l _zip "wakatime-cli-linux-$_arch.zip"
|
||||
set -l _bin_src "wakatime-cli-linux-$_arch"
|
||||
set -l _wt_dir "$HOME/.config/wakatime"
|
||||
set -l _wt_bin "$_wt_dir/wakatime"
|
||||
set -l _tmpdir (mktemp -d)
|
||||
curl -L "https://github.com/wakatime/wakatime-cli/releases/latest/download/$_zip" \
|
||||
-o "$_tmpdir/$_zip"
|
||||
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
|
||||
and mkdir -p "$_wt_dir" "$HOME/.local/bin"
|
||||
and cp "$_tmpdir/$_bin_src" "$_wt_bin"
|
||||
and chmod +x "$_wt_bin"
|
||||
and ln -sf "$_wt_bin" "$HOME/.local/bin/wakatime"
|
||||
rm -rf "$_tmpdir"
|
||||
case special-fzf
|
||||
fzf-update
|
||||
case special-fisher
|
||||
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source
|
||||
fisher update
|
||||
case special-curl
|
||||
if test "$bin" = starship
|
||||
curl -sS https://starship.rs/install.sh | sh
|
||||
end
|
||||
case special-yay-paru
|
||||
yay -S --noconfirm paru
|
||||
case special-paru
|
||||
set -l _build_dir (mktemp -d)
|
||||
git clone https://aur.archlinux.org/paru.git $_build_dir
|
||||
and pushd $_build_dir
|
||||
and makepkg -si --noconfirm
|
||||
and popd
|
||||
rm -rf $_build_dir
|
||||
case special-uv
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
# Add uv to PATH for the rest of this session
|
||||
for _d in "$HOME/.local/bin" "$HOME/.cargo/bin"
|
||||
if test -d "$_d"
|
||||
fish_add_path "$_d"
|
||||
break
|
||||
end
|
||||
end
|
||||
if not type -q uv
|
||||
set_color yellow
|
||||
echo " uv not yet in PATH — restart your shell if subsequent installs fail."
|
||||
set_color normal
|
||||
end
|
||||
case special-git-cargo-fish
|
||||
set -l _tmpdir (mktemp -d)
|
||||
set -l _build_ok 0
|
||||
git clone https://github.com/fish-shell/fish-shell "$_tmpdir"
|
||||
and begin
|
||||
set -l _tag (git -C "$_tmpdir" tag --list 'fish-*' --sort=version:refname | tail -1)
|
||||
test -n "$_tag"; and git -C "$_tmpdir" checkout "$_tag"
|
||||
true
|
||||
end
|
||||
and pushd "$_tmpdir"
|
||||
and uv run --no-managed-python cargo install --path .
|
||||
and set _build_ok 1
|
||||
popd 2>/dev/null
|
||||
rm -rf "$_tmpdir"
|
||||
test $_build_ok -eq 1
|
||||
case special-pipx
|
||||
pipx install $bin
|
||||
case special-pip
|
||||
pip install --user $bin
|
||||
end
|
||||
|
||||
if test $status -eq 0
|
||||
set installed_any 1
|
||||
set_color green; echo " $bin "(string lower $upgrade_label)"ed."; set_color normal
|
||||
if test "$bin" = fish
|
||||
set_color yellow
|
||||
echo " Fish upgraded — restart your shell to use the new version."
|
||||
set_color normal
|
||||
end
|
||||
else
|
||||
set_color red; echo " $bin "(string lower $upgrade_label)" failed."; set_color normal
|
||||
end
|
||||
end
|
||||
set i (math $i + 1)
|
||||
end
|
||||
|
||||
if test $installed_any -eq 0
|
||||
echo "Nothing to install."
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Install a package via the system PM.
|
||||
# Usage: _fish_deps_pm_install <pkg>
|
||||
function _fish_deps_pm_install --argument-names pkg
|
||||
set -l pm (_fish_deps_detect_pm)
|
||||
if test -z "$pm"
|
||||
echo "No supported package manager found." >&2
|
||||
return 1
|
||||
end
|
||||
switch $pm
|
||||
case paru yay
|
||||
$pm -S --noconfirm $pkg
|
||||
case pacman
|
||||
sudo pacman -S --noconfirm $pkg
|
||||
case apt
|
||||
sudo apt install -y $pkg
|
||||
case brew
|
||||
brew install $pkg
|
||||
case pkg
|
||||
sudo pkg install -y $pkg
|
||||
case dnf
|
||||
sudo dnf install -y $pkg
|
||||
case yum
|
||||
sudo yum install -y $pkg
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Upgrade an already-installed package via the system PM.
|
||||
# Usage: _fish_deps_pm_upgrade <pkg>
|
||||
function _fish_deps_pm_upgrade --argument-names pkg
|
||||
set -l pm (_fish_deps_detect_pm)
|
||||
if test -z "$pm"
|
||||
echo "No supported package manager found." >&2
|
||||
return 1
|
||||
end
|
||||
switch $pm
|
||||
case paru yay
|
||||
$pm -S --noconfirm $pkg
|
||||
case pacman
|
||||
sudo pacman -S --noconfirm $pkg
|
||||
case apt
|
||||
sudo apt install --only-upgrade -y $pkg
|
||||
case brew
|
||||
brew upgrade $pkg
|
||||
case pkg
|
||||
sudo pkg upgrade -y $pkg
|
||||
case dnf
|
||||
sudo dnf upgrade -y $pkg
|
||||
case yum
|
||||
sudo yum update -y $pkg
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,50 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Print colored installed/missing status for all deps, grouped by tier.
|
||||
function _fish_deps_status
|
||||
_fish_deps_catalog
|
||||
|
||||
function __fds_print_dep --argument-names bin tier
|
||||
if type -q $bin
|
||||
# Special version check: fish < 4.0 is functionally incompatible
|
||||
if test "$bin" = fish
|
||||
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
|
||||
if test -n "$_major"; and test "$_major" -lt 4
|
||||
set -l _ver (fish --version 2>&1 | string replace 'fish, ' '')
|
||||
set_color yellow; echo -n " ⚠ "; set_color normal
|
||||
echo -n "$bin "
|
||||
set_color brblack; echo "($_ver — upgrade to 4.0+ required)"; set_color normal
|
||||
return
|
||||
end
|
||||
end
|
||||
set_color green; echo -n " ✓ "; set_color normal
|
||||
echo -n "$bin "
|
||||
set_color brblack; echo "(Found at "(type -p $bin)")"; set_color normal
|
||||
else if test "$tier" = rec
|
||||
set_color yellow; echo -n " ⚠ "; set_color normal
|
||||
echo -n "$bin "
|
||||
set_color brblack; echo "(Not installed)"; set_color normal
|
||||
else
|
||||
set_color red; echo -n " ✗ "; set_color normal
|
||||
echo -n "$bin "
|
||||
set_color brblack; echo "(Not installed)"; set_color normal
|
||||
end
|
||||
end
|
||||
|
||||
for tier_label in "Required Dependencies:req" "Integrations:int" "Recommended Dependencies:rec"
|
||||
set -l label (string split : $tier_label)[1]
|
||||
set -l tier (string split : $tier_label)[2]
|
||||
set_color cyan; echo $label; set_color normal
|
||||
set -l i 1
|
||||
for bin in $_fdc_bins
|
||||
if test "$_fdc_tiers[$i]" = $tier
|
||||
__fds_print_dep $bin $tier
|
||||
end
|
||||
set i (math $i + 1)
|
||||
end
|
||||
echo ""
|
||||
end
|
||||
|
||||
functions -e __fds_print_dep
|
||||
end
|
||||
@@ -0,0 +1,177 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Update all installed deps using their known install method.
|
||||
# Priority: cargo > system PM > special (fzf-update, fisher, pipx).
|
||||
function _fish_deps_update
|
||||
_fish_deps_catalog
|
||||
|
||||
set -l pm (_fish_deps_detect_pm)
|
||||
set -l updated_any 0
|
||||
|
||||
# Fisher plugins — always update if fisher is present
|
||||
if type -q fisher
|
||||
echo "Updating fisher plugins..."
|
||||
fisher update
|
||||
set updated_any 1
|
||||
end
|
||||
|
||||
set -l i 1
|
||||
for bin in $_fdc_bins
|
||||
# Skip fisher itself (handled above) and tools that aren't installed
|
||||
if test "$bin" = fisher; or not type -q $bin
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
set -l cargo_crate $_fdc_cargo[$i]
|
||||
set -l pm_pkg $_fdc_pm[$i]
|
||||
set -l special $_fdc_special[$i]
|
||||
|
||||
# cargo: update via rustup
|
||||
if test "$special" = rustup-installer
|
||||
if type -q rustup
|
||||
echo "Updating $bin..."
|
||||
rustup update
|
||||
set updated_any 1
|
||||
end
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# fzf: always use fzf-update (git-based)
|
||||
if test "$special" = fzf-update
|
||||
echo "Updating $bin..."
|
||||
fzf-update
|
||||
set updated_any 1
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# lazydocker: re-run the official install/update script
|
||||
if test "$special" = curl-lazydocker
|
||||
echo "Updating $bin..."
|
||||
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
|
||||
set updated_any 1
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# wakatime: re-download the binary from github releases
|
||||
if test "$special" = wakatime-binary
|
||||
echo "Updating $bin..."
|
||||
set -l _arch (uname -m)
|
||||
switch $_arch
|
||||
case x86_64; set _arch amd64
|
||||
case aarch64 arm64; set _arch arm64
|
||||
case armv7l; set _arch arm
|
||||
case '*'; set _arch amd64
|
||||
end
|
||||
set -l _zip "wakatime-cli-linux-$_arch.zip"
|
||||
set -l _bin_src "wakatime-cli-linux-$_arch"
|
||||
set -l _wt_bin "$HOME/.config/wakatime/wakatime"
|
||||
set -l _tmpdir (mktemp -d)
|
||||
curl -L "https://github.com/wakatime/wakatime-cli/releases/latest/download/$_zip" \
|
||||
-o "$_tmpdir/$_zip"
|
||||
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
|
||||
and cp "$_tmpdir/$_bin_src" "$_wt_bin"
|
||||
and chmod +x "$_wt_bin"
|
||||
rm -rf "$_tmpdir"
|
||||
and set updated_any 1
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# pipx tools
|
||||
if test "$special" = pipx
|
||||
if type -q pipx
|
||||
echo "Updating $bin..."
|
||||
pipx upgrade $bin
|
||||
set updated_any 1
|
||||
end
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# uv: use built-in self-updater
|
||||
if test "$special" = curl-uv
|
||||
echo "Updating $bin..."
|
||||
uv self update
|
||||
set updated_any 1
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# fish: prefer build from source via git + cargo; fall back to PM
|
||||
if test "$special" = git-cargo-fish
|
||||
if type -q cargo; and type -q uv
|
||||
echo "Updating $bin..."
|
||||
set -l _tmpdir (mktemp -d)
|
||||
set -l _build_ok 0
|
||||
git clone https://github.com/fish-shell/fish-shell "$_tmpdir"
|
||||
and begin
|
||||
set -l _tag (git -C "$_tmpdir" tag --list 'fish-*' --sort=version:refname | tail -1)
|
||||
test -n "$_tag"; and git -C "$_tmpdir" checkout "$_tag"
|
||||
true
|
||||
end
|
||||
and pushd "$_tmpdir"
|
||||
and uv run --no-managed-python cargo install --path .
|
||||
and set _build_ok 1
|
||||
popd 2>/dev/null
|
||||
rm -rf "$_tmpdir"
|
||||
if test $_build_ok -eq 1
|
||||
set updated_any 1
|
||||
set_color yellow
|
||||
echo " Fish updated — restart your shell to use the new version."
|
||||
set_color normal
|
||||
end
|
||||
else if test -n "$pm_pkg"; and test -n "$pm"
|
||||
echo "Updating $bin (cargo/uv unavailable, using system PM)..."
|
||||
_fish_deps_pm_upgrade $pm_pkg
|
||||
set updated_any 1
|
||||
set_color yellow
|
||||
echo " Fish updated — restart your shell to use the new version."
|
||||
set_color normal
|
||||
else
|
||||
set_color yellow
|
||||
echo " fish: cannot update — install cargo and uv to build from source"
|
||||
set_color normal
|
||||
end
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# curl-installer tools (starship etc.): re-run install script, which upgrades in place
|
||||
if test "$special" = curl-installer
|
||||
if test "$bin" = starship
|
||||
echo "Updating $bin..."
|
||||
curl -sS https://starship.rs/install.sh | sh -s -- --yes
|
||||
set updated_any 1
|
||||
end
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# Cargo: prefer for Rust tools
|
||||
if test -n "$cargo_crate"; and type -q cargo
|
||||
echo "Updating $bin..."
|
||||
cargo install --force $cargo_crate
|
||||
set updated_any 1
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# System PM fallback
|
||||
if test -n "$pm_pkg"; and test -n "$pm"
|
||||
echo "Updating $bin..."
|
||||
_fish_deps_pm_upgrade $pm_pkg
|
||||
set updated_any 1
|
||||
end
|
||||
|
||||
set i (math $i + 1)
|
||||
end
|
||||
|
||||
if test $updated_any -eq 0
|
||||
echo "Nothing to update."
|
||||
end
|
||||
end
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
# Returns the result of a qalc calculation
|
||||
function _qalc_eval
|
||||
type -q qalc || return 1
|
||||
|
||||
# Get the current command line buffer
|
||||
set -l cmd (commandline)
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ function _smart_execute --description 'Execute different functions based on the
|
||||
# 2. Dispatch based on buffer content
|
||||
switch "$cmd"
|
||||
case '*='
|
||||
# If it ends in =, run qalc
|
||||
_qalc_eval
|
||||
# If it ends in =, run qalc; fall back to normal execute if qalc is absent
|
||||
_qalc_eval; or commandline -f execute
|
||||
|
||||
# case 'g *'
|
||||
# # EXAMPLE FUTURE EXTENSION
|
||||
|
||||
@@ -1,50 +1,7 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Check all fish-related dependencies
|
||||
# Thin wrapper kept for backwards compatibility.
|
||||
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
|
||||
fish-deps status
|
||||
end
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function fish-deps --description 'Manage fish shell dependencies'
|
||||
set -l subcmd $argv[1]
|
||||
|
||||
switch $subcmd
|
||||
case status ''
|
||||
_fish_deps_status
|
||||
case install
|
||||
_fish_deps_install
|
||||
case update
|
||||
_fish_deps_update
|
||||
case sync
|
||||
echo "=== Installing missing deps ==="
|
||||
_fish_deps_install
|
||||
echo ""
|
||||
echo "=== Updating installed deps ==="
|
||||
_fish_deps_update
|
||||
case '*'
|
||||
set_color red
|
||||
echo "Unknown subcommand: $subcmd"
|
||||
set_color normal
|
||||
echo ""
|
||||
__fish_deps_help
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_deps_help
|
||||
set_color cyan; echo "fish-deps — manage fish shell dependencies"; set_color normal
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo " fish-deps [status] Check installed/missing deps (default)"
|
||||
echo " fish-deps install Install missing deps interactively"
|
||||
echo " fish-deps update Update all installed deps"
|
||||
echo " fish-deps sync Install missing, then update all"
|
||||
echo ""
|
||||
echo "Install method priority: cargo > system PM > git/curl/pipx"
|
||||
echo "When multiple methods are available, you will be prompted to choose."
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Installs or upgrades fzf from git HEAD into ~/.fzf
|
||||
function fzf-update --description 'Install or upgrade fzf from git HEAD'
|
||||
if test -d ~/.fzf
|
||||
echo "Updating fzf..."
|
||||
git -C ~/.fzf pull --ff-only
|
||||
else
|
||||
echo "Installing fzf..."
|
||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
||||
end
|
||||
and ~/.fzf/install --bin
|
||||
and echo "fzf $(fzf --version) ready. Restart your shell to activate."
|
||||
end
|
||||
+11
-4
@@ -3,16 +3,23 @@
|
||||
|
||||
# Interactively search and remove an installed package using fzf
|
||||
function parur --description 'Interactively search and remove an installed package using fzf'
|
||||
# 1. Use command substitution to get the package list from fzf
|
||||
set -l aur ""
|
||||
if type -q paru
|
||||
set aur paru
|
||||
else if type -q yay
|
||||
set aur yay
|
||||
else
|
||||
echo "No AUR helper found (install paru or yay)" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l pkg_list (
|
||||
pacman -Qqs \
|
||||
| fzf --preview 'pacman -Qi {}' --multi
|
||||
)
|
||||
|
||||
# 2. Check if a package was selected.
|
||||
if test (count $pkg_list) -gt 0
|
||||
# 3. Pass the selected packages directly to paru -R
|
||||
paru -R $pkg_list
|
||||
$aur -R $pkg_list
|
||||
else
|
||||
echo "No packages selected for removal."
|
||||
end
|
||||
|
||||
+11
-6
@@ -1,10 +1,15 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Function for installing packages with paru.
|
||||
# This runs `paru` with the `-S` flag to install one or more packages.
|
||||
# The `$argv` variable passes all arguments given to the `pkg` function
|
||||
# directly to the `paru` command.
|
||||
function pkg --wraps='paru' --description 'directly to the `paru` command.'
|
||||
paru -S $argv
|
||||
function pkg --description 'Install packages via paru or yay'
|
||||
set -l aur ""
|
||||
if type -q paru
|
||||
set aur paru
|
||||
else if type -q yay
|
||||
set aur yay
|
||||
else
|
||||
echo "No AUR helper found (install paru or yay)" >&2
|
||||
return 1
|
||||
end
|
||||
$aur -S $argv
|
||||
end
|
||||
|
||||
+11
-6
@@ -1,10 +1,15 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Function for searching for packages to install with paru.
|
||||
# This runs `paru` with the search flags.
|
||||
# The `$argv` variable passes all arguments given to the `search` function
|
||||
# directly to the `paru` command.
|
||||
function search --wraps='paru' --description 'directly to the `paru` command.'
|
||||
paru $argv
|
||||
function search --description 'Search/install packages interactively via paru or yay'
|
||||
set -l aur ""
|
||||
if type -q paru
|
||||
set aur paru
|
||||
else if type -q yay
|
||||
set aur yay
|
||||
else
|
||||
echo "No AUR helper found (install paru or yay)" >&2
|
||||
return 1
|
||||
end
|
||||
$aur $argv
|
||||
end
|
||||
|
||||
+11
-5
@@ -1,9 +1,15 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
# Function for upgrading the system with paru.
|
||||
# This runs `paru` with the `-Syu` flags to sync, refresh, and upgrade all
|
||||
# packages, and adds `--no-confirm` to bypass the confirmation prompt.
|
||||
function upgrade --wraps='paru' --description 'packages, and adds `--no-confirm` to bypass the confirmation prompt.'
|
||||
paru -Syu --noconfirm
|
||||
function upgrade --description 'Full system upgrade via paru or yay'
|
||||
set -l aur ""
|
||||
if type -q paru
|
||||
set aur paru
|
||||
else if type -q yay
|
||||
set aur yay
|
||||
else
|
||||
echo "No AUR helper found (install paru or yay)" >&2
|
||||
return 1
|
||||
end
|
||||
$aur -Syu --noconfirm
|
||||
end
|
||||
|
||||
+27
-3
@@ -31,6 +31,14 @@ function fzf_key_bindings
|
||||
return 1
|
||||
end
|
||||
|
||||
# bg-transform runs the preview toggle in a background thread (non-blocking).
|
||||
# It was added after fzf 0.60; fall back to the synchronous transform on older builds.
|
||||
set -l _fzf_ver (fzf --version | string match -r '^(\d+)\.(\d+)')
|
||||
set -l _fzf_transform_action transform
|
||||
if test -n "$_fzf_ver[3]"; and test "$_fzf_ver[3]" -ge 62
|
||||
set _fzf_transform_action bg-transform
|
||||
end
|
||||
|
||||
#----BEGIN INCLUDE common.fish
|
||||
# NOTE: Do not directly edit this section, which is copied from "common.fish".
|
||||
# To modify it, one can edit "common.fish" and run "./update.sh" to apply
|
||||
@@ -177,17 +185,25 @@ function fzf_key_bindings
|
||||
commandline -f repaint
|
||||
end
|
||||
|
||||
function fzf-history-widget -d "Show command history"
|
||||
function fzf-history-widget --inherit-variable _fzf_transform_action -d "Show command history"
|
||||
set -l -- command_line (commandline)
|
||||
set -l -- current_line (commandline -L)
|
||||
set -l -- total_lines (count $command_line)
|
||||
set -l -- fzf_query (string escape -- $command_line[$current_line])
|
||||
|
||||
# These options require newer fzf; omit them on older builds
|
||||
set -l _fzf_preview_wrap_sign ''
|
||||
set -l _fzf_toggle_raw ''
|
||||
if test "$_fzf_transform_action" = bg-transform
|
||||
set _fzf_preview_wrap_sign ' --preview-wrap-sign="↳ "'
|
||||
set _fzf_toggle_raw ,alt-r:toggle-raw
|
||||
end
|
||||
|
||||
set -lx -- FZF_DEFAULT_OPTS (__fzf_defaults '' \
|
||||
'--nth=2..,.. --scheme=history --multi --no-multi-line --no-wrap --wrap-sign="\t\t\t↳ " --preview-wrap-sign="↳ "' \
|
||||
'--nth=2..,.. --scheme=history --multi --no-multi-line --no-wrap --wrap-sign="\t\t\t↳ "'$_fzf_preview_wrap_sign \
|
||||
'--bind=\'shift-delete:execute-silent(for i in (string split0 -- <{+f}); eval builtin history delete --exact --case-sensitive -- (string escape -n -- $i | string replace -r "^\d*\\\\\\t" ""); end)+reload(eval $FZF_DEFAULT_COMMAND)\'' \
|
||||
'--bind="alt-enter:become(string join0 -- (string collect -- {+2..} | fish_indent -i))"' \
|
||||
"--bind=ctrl-r:toggle-sort,alt-r:toggle-raw --highlight-line $FZF_CTRL_R_OPTS" \
|
||||
"--bind=ctrl-r:toggle-sort$_fzf_toggle_raw --highlight-line $FZF_CTRL_R_OPTS" \
|
||||
'--accept-nth=2.. --delimiter="\t" --tabstop=4 --read0 --print0 --with-shell='(status fish-path)\\ -c)
|
||||
|
||||
# Add dynamic preview options if preview command isn't already set by user
|
||||
@@ -205,10 +221,18 @@ function fzf_key_bindings
|
||||
end
|
||||
|
||||
# Prepend the options to allow user customizations
|
||||
if test "$_fzf_transform_action" = bg-transform
|
||||
# Newer fzf: dynamic show/hide preview based on terminal width
|
||||
set -p -- FZF_DEFAULT_OPTS \
|
||||
'--bind="focus,resize:bg-transform:if test \\"$FZF_COLUMNS\\" -gt 100 -a \\\\( \\"$FZF_SELECT_COUNT\\" -gt 0 -o \\\\( -z \\"$FZF_WRAP\\" -a (string length -- {}) -gt (math $FZF_COLUMNS - 4) \\\\) -o (string collect -- {2..} | fish_indent | count) -gt 1 \\\\); echo show-preview; else echo hide-preview; end"' \
|
||||
'--preview="string collect -- (test \\"$FZF_SELECT_COUNT\\" -gt 0; and string collect -- {+2..}) \\"\\n# \\"'$date_cmd' {2..} | fish_indent --ansi"' \
|
||||
'--preview-window="right,50%,wrap-word,follow,info,hidden"'
|
||||
else
|
||||
# Older fzf: static preview; focus/resize events not reliably supported
|
||||
set -p -- FZF_DEFAULT_OPTS \
|
||||
'--preview="string collect -- (test \\"$FZF_SELECT_COUNT\\" -gt 0; and string collect -- {+2..}) \\"\\n# \\"'$date_cmd' {2..} | fish_indent --ansi"' \
|
||||
'--preview-window="right,50%,wrap,follow,info"'
|
||||
end
|
||||
end
|
||||
|
||||
set -lx FZF_DEFAULT_OPTS_FILE
|
||||
|
||||
Reference in New Issue
Block a user