Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
9e7539d863
|
|||
|
6fd1e3221e
|
|||
|
df7c921bc6
|
|||
|
abbbf20b40
|
@@ -491,19 +491,28 @@ Named context shortcuts (e.g. `dcr`, `dck`) live in `~/.config/.user-dots/fish/l
|
|||||||
|
|
||||||
### Required
|
### Required
|
||||||
|
|
||||||
| Tool | Purpose |
|
| Tool | Version | Purpose |
|
||||||
|---|---|
|
|---|---|---|
|
||||||
| [Fish](https://fishshell.com/) | Shell |
|
| [Fish](https://fishshell.com/) | **≥ 4.0** | Shell |
|
||||||
| [Fisher](https://github.com/jorgebucaran/fisher) | Plugin manager |
|
| [Fisher](https://github.com/jorgebucaran/fisher) | any | Plugin manager |
|
||||||
| [Starship](https://starship.rs/) | Prompt |
|
| [Starship](https://starship.rs/) | any | Prompt |
|
||||||
| [fzf](https://github.com/junegunn/fzf) | Fuzzy finder |
|
| [fzf](https://github.com/junegunn/fzf) | any | Fuzzy finder |
|
||||||
| [zoxide](https://github.com/ajeetdsouza/zoxide) | Smart directory jumper |
|
| [zoxide](https://github.com/ajeetdsouza/zoxide) | any | Smart directory jumper |
|
||||||
| [direnv](https://direnv.net/) | Per-directory env loading |
|
| [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.
|
||||||
|
> If you are on an older Fish, you can upgrade via cargo (Fish 4.x is a Rust rewrite published to crates.io):
|
||||||
|
> ```
|
||||||
|
> cargo install fish
|
||||||
|
> ```
|
||||||
|
> Or run `fish-deps update` once cargo is available — it will upgrade Fish via cargo automatically.
|
||||||
|
|
||||||
### Recommended
|
### Recommended
|
||||||
|
|
||||||
| Tool | Replaces |
|
| 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) |
|
| [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) |
|
| [eza](https://github.com/eza-community/eza) | `ls` (preferred) |
|
||||||
| [lsd](https://github.com/lsd-rs/lsd) | `ls` (fallback) |
|
| [lsd](https://github.com/lsd-rs/lsd) | `ls` (fallback) |
|
||||||
|
|||||||
@@ -2,38 +2,40 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
# Populates parallel arrays describing every managed dependency.
|
# Populates parallel arrays describing every managed dependency.
|
||||||
# Callers must invoke this function before accessing _fdc_* variables.
|
# Callers must invoke this function before accessing _fdc_* arrays.
|
||||||
#
|
#
|
||||||
# Array layout (same index across all sets):
|
# Array layout (same index across all sets):
|
||||||
# _fdc_bins — binary name (what `type -q` checks)
|
# _fdc_bins — binary name (what `type -q` checks)
|
||||||
# _fdc_tiers — req | int | rec
|
# _fdc_tiers — req | int | rec
|
||||||
# _fdc_cargo — cargo crate name, or "" if not on crates.io
|
# _fdc_cargo — cargo crate name, or "" if not on crates.io
|
||||||
# _fdc_pm — system PM package name, or "" if not in repos
|
# _fdc_pm — system PM package name, or "" if not in repos
|
||||||
# _fdc_special — special install key: fisher-bootstrap | fzf-update |
|
# _fdc_special — special install key: rustup-installer | fisher-bootstrap |
|
||||||
# pipx | curl-installer | "" (none)
|
# fzf-update | paru-build | pipx | curl-installer | "" (none)
|
||||||
|
#
|
||||||
|
# cargo is listed second so it is installed before Rust tools that depend on it.
|
||||||
function _fish_deps_catalog
|
function _fish_deps_catalog
|
||||||
set -g _fdc_bins \
|
set -g _fdc_bins \
|
||||||
fish fisher starship fzf zoxide direnv paru \
|
fish cargo fisher starship fzf zoxide direnv paru \
|
||||||
wakatime tailscale \
|
wakatime tailscale \
|
||||||
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
|
eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
|
||||||
|
|
||||||
set -g _fdc_tiers \
|
set -g _fdc_tiers \
|
||||||
req req req req req req rec \
|
req req req req req req req rec \
|
||||||
int int \
|
int int \
|
||||||
rec rec rec rec rec rec rec rec rec rec rec rec rec rec
|
rec rec rec rec rec rec rec rec rec rec rec rec rec rec
|
||||||
|
|
||||||
set -g _fdc_cargo \
|
set -g _fdc_cargo \
|
||||||
"" "" starship "" zoxide "" "" \
|
fish "" "" starship "" zoxide "" "" \
|
||||||
"" "" \
|
"" "" \
|
||||||
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trash-cli "" ""
|
eza lsd bat "" du-dust "" "" "" ripgrep "" "" trash-cli "" ""
|
||||||
|
|
||||||
set -g _fdc_pm \
|
set -g _fdc_pm \
|
||||||
fish "" starship fzf zoxide direnv "" \
|
fish cargo "" starship fzf zoxide direnv "" \
|
||||||
wakatime tailscale \
|
wakatime tailscale \
|
||||||
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
|
eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm
|
||||||
|
|
||||||
set -g _fdc_special \
|
set -g _fdc_special \
|
||||||
"" fisher-bootstrap curl-installer fzf-update "" "" "" \
|
"" rustup-installer fisher-bootstrap curl-installer fzf-update "" "" paru-build \
|
||||||
pipx "" \
|
pipx "" \
|
||||||
"" "" "" "" "" "" "" "" "" "" "" "" "" ""
|
"" "" "" "" "" "" "" "" "" "" "" "" "" ""
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,25 +20,31 @@ function _fish_deps_install
|
|||||||
set -l methods
|
set -l methods
|
||||||
set -l method_labels
|
set -l method_labels
|
||||||
|
|
||||||
# Cargo first — preferred for Rust tools; gets the latest crate version
|
# Cargo — preferred for Rust tools; gets the latest crate version
|
||||||
if test -n "$cargo_crate"
|
if test -n "$cargo_crate"
|
||||||
if type -q cargo
|
if type -q cargo
|
||||||
set -a methods cargo
|
set -a methods cargo
|
||||||
set -a method_labels "cargo ($cargo_crate)"
|
set -a method_labels "cargo ($cargo_crate)"
|
||||||
else
|
else
|
||||||
set_color brblack
|
set_color brblack
|
||||||
echo " note: cargo not found — install rustup for the latest $bin"
|
echo " note: cargo not found — install cargo first for the latest $bin"
|
||||||
set_color normal
|
set_color normal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# System PM — after cargo so cargo is always the default when available
|
# rustup installer — listed before system PM so it is the default for cargo itself
|
||||||
|
if test "$special" = rustup-installer
|
||||||
|
set -a methods special-rustup
|
||||||
|
set -a method_labels "rustup installer (curl | sh)"
|
||||||
|
end
|
||||||
|
|
||||||
|
# System PM — after cargo/rustup so those are always the default when available
|
||||||
if test -n "$pm_pkg"; and test -n "$pm"
|
if test -n "$pm_pkg"; and test -n "$pm"
|
||||||
set -a methods pm
|
set -a methods pm
|
||||||
set -a method_labels "$pm ($pm_pkg)"
|
set -a method_labels "$pm ($pm_pkg)"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Special methods
|
# Remaining special methods
|
||||||
switch $special
|
switch $special
|
||||||
case fzf-update
|
case fzf-update
|
||||||
set -a methods special-fzf
|
set -a methods special-fzf
|
||||||
@@ -49,6 +55,16 @@ function _fish_deps_install
|
|||||||
case curl-installer
|
case curl-installer
|
||||||
set -a methods special-curl
|
set -a methods special-curl
|
||||||
set -a method_labels "curl installer"
|
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
|
case pipx
|
||||||
if type -q pipx
|
if type -q pipx
|
||||||
set -a methods special-pipx
|
set -a methods special-pipx
|
||||||
@@ -98,6 +114,8 @@ function _fish_deps_install
|
|||||||
cargo install $cargo_crate
|
cargo install $cargo_crate
|
||||||
case pm
|
case pm
|
||||||
_fish_deps_pm_install $pm_pkg
|
_fish_deps_pm_install $pm_pkg
|
||||||
|
case special-rustup
|
||||||
|
curl https://sh.rustup.rs -sSf | sh
|
||||||
case special-fzf
|
case special-fzf
|
||||||
fzf-update
|
fzf-update
|
||||||
case special-fisher
|
case special-fisher
|
||||||
@@ -107,6 +125,15 @@ function _fish_deps_install
|
|||||||
if test "$bin" = starship
|
if test "$bin" = starship
|
||||||
curl -sS https://starship.rs/install.sh | sh
|
curl -sS https://starship.rs/install.sh | sh
|
||||||
end
|
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-pipx
|
case special-pipx
|
||||||
pipx install $bin
|
pipx install $bin
|
||||||
case special-pip
|
case special-pip
|
||||||
|
|||||||
@@ -28,6 +28,17 @@ function _fish_deps_update
|
|||||||
set -l pm_pkg $_fdc_pm[$i]
|
set -l pm_pkg $_fdc_pm[$i]
|
||||||
set -l special $_fdc_special[$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)
|
# fzf: always use fzf-update (git-based)
|
||||||
if test "$special" = fzf-update
|
if test "$special" = fzf-update
|
||||||
echo "Updating $bin..."
|
echo "Updating $bin..."
|
||||||
@@ -64,6 +75,11 @@ function _fish_deps_update
|
|||||||
echo "Updating $bin..."
|
echo "Updating $bin..."
|
||||||
cargo install --force $cargo_crate
|
cargo install --force $cargo_crate
|
||||||
set updated_any 1
|
set updated_any 1
|
||||||
|
if test "$bin" = fish
|
||||||
|
set_color yellow
|
||||||
|
echo " Fish updated — restart your shell to use the new version."
|
||||||
|
set_color normal
|
||||||
|
end
|
||||||
set i (math $i + 1)
|
set i (math $i + 1)
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user