diff --git a/README.md b/README.md index 25fb07e..a140bfb 100644 --- a/README.md +++ b/README.md @@ -271,6 +271,7 @@ rm -f file.txt # Falls through to standard rm -f | Function | Description | |---|---| | `mkcd ` | Create directory (including missing parents) and `cd` into it | +| `poke ...` | `touch` with automatic parent directory creation; prints a colored notice when new directories are created | | `ls` | `eza` — long listing, all files, icons, color, hyperlinks | | `lss` | `eza` — size-sorted long listing with gradient color scale | | `lsr` | `eza` — reversed time-sorted oneline listing | diff --git a/config.fish b/config.fish index 7e51587..dafaf17 100644 --- a/config.fish +++ b/config.fish @@ -11,16 +11,12 @@ if test -f /usr/share/cachyos-fish-config/cachyos-config.fish # Source our tricks over the cachyOS config test -f "$__fish_config_dir/conf.d/tricks.fish" and source "$__fish_config_dir/conf.d/tricks.fish" - # CachyOS defines aliases for ls/lt/cleanup that shadow our function files. - # Erase them and immediately source our versions. - for _fname in ls lt cleanup + # Erase CachyOS aliases/functions that shadow our versions, then + # re-source our versions since functions --erase removes autoload entries. + for _fname in ls lt cleanup copy functions --erase $_fname source "$__fish_config_dir/functions/$_fname.fish" end - # CachyOS defines a broken copy command. - # Override it with our working function. - test -f "$__fish_config_dir/functions/copy.fish" - and source "$__fish_config_dir/functions/copy.fish" end set --erase _fname @@ -50,7 +46,6 @@ set -gx NVIDIA_SETTINGS_RW_CONFIG_FILE "$XDG_CONFIG_HOME/nvidia/settings" set -gx CODEIUM_HOME "$XDG_CONFIG_HOME/codeium" set -gx WORDLIST "$XDG_CONFIG_HOME/hunspell_en_US" -# ───────────────────── Misc Configuration variables ───────────────────── # ─────────────────────────── Pager variables ──────────────────────────── if type -q ov set -gx PAGER ov @@ -133,7 +128,7 @@ if not type -q fisher set --erase _fisher_reply end -# ─────────────────────── visual/interactive setup ─────────────────────── +# ─────────────────────── Visual/Interactive setup ─────────────────────── # Run only if we're in an interactive session (not a script or non-interactive shell) if status is-interactive # ────────────────────────────── Key bindings ──────────────────────────── @@ -173,8 +168,8 @@ if status is-interactive set -gx CLAUDE_CODE_NO_FLICKER 1 # ╭────────────────────────────── OVERRIDES ─────────────────────────────╮ - # | Run these last so they can override any previous settings. | - # | This is useful for machine-specific behavior or configurations. | + # │ Run these last so they can override any previous settings. │ + # │ This is useful for machine-specific behavior or configurations. │ # ╰────────────────────────────── OVERRIDES ─────────────────────────────╯ # # Define user-dots path variable for a more legible secrets/local config. @@ -196,26 +191,18 @@ if status is-interactive test -f "$dot_fish/local.fish"; and source "$dot_fish/local.fish" # # ╭──────────────────────────── END OVERRIDES ──────────────────────────╮ - # | End of override section. | + # │ End of override section. │ # ╰──────────────────────────── END OVERRIDES ──────────────────────────╯ - - # ───────────────────────────────────────────────────────────────────────── - # Tools like starship, zoxide, etc. append init lines below this point via their - # setup commands. We manage all integrations through conf.d/ instead, so we - # return here to prevent injected lines from conflicting with that setup. - # - # This catches injections within the interactive block and - # prevents them from conflicting with our conf.d/ setup. - return # <-- Do not remove this line. - # ───────────────────────────────────────────────────────────────────────── end -# ───────────────────────────────────────────────────────────────────────────── -# Tools like starship, zoxide, etc. append init lines below this point via their -# setup commands. We manage all integrations through conf.d/ instead, so we -# return here to prevent injected lines from conflicting with that setup. -# -# This catches injections outside the interactive block and -# prevents them from conflicting with our conf.d/ setup. return # <-- Do not remove this line. -# ───────────────────────────────────────────────────────────────────────────── +# ╭──────────────────────────────── !!!NOTE!!! ───────────────────────────────╮ +# │ Tools like starship, zoxide, etc. append init lines below this point │ +# │ via their setup commands. We manage these integrations through │ +# │ conf.d/ instead, so we return here to prevent duplicate or conflicting │ +# │ inits from being executed. │ +# │ │ +# │ If a tool's shell integration appears to do nothing, │ +# │ check whether its setup command appended an init line here, │ +# │ then create a conf.d/.fish instead and place the init in that file. │ +# ╰───────────────────────────────────────────────────────────────────────────╯ diff --git a/functions/_fish_deps_catalog.fish b/functions/_fish_deps_catalog.fish index 3f4cea0..89a3023 100644 --- a/functions/_fish_deps_catalog.fish +++ b/functions/_fish_deps_catalog.fish @@ -16,27 +16,27 @@ # 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 \ + uv cargo fish fisher starship fzf zoxide direnv paru yay \ wakatime tailscale \ - eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm + eza lsd bat btop dust duf prettyping ov rg lazygit lazydocker trash kitty wezterm set -g _fdc_tiers \ - req req req req req req req req rec \ + req req req req req req req req rec rec \ int int \ rec rec rec rec rec rec rec rec rec rec rec rec rec rec set -g _fdc_cargo \ - "" "" "" "" starship "" zoxide "" "" \ + "" "" "" "" starship "" zoxide "" "" "" \ "" "" \ - eza lsd bat "" du-dust "" "" "" ripgrep "" "" trashy "" "" + eza lsd bat "" du-dust "" "" ov ripgrep "" "" trashy "" "" set -g _fdc_pm \ - uv cargo fish "" starship fzf zoxide direnv "" \ + uv cargo fish "" starship fzf zoxide direnv "" yay \ wakatime tailscale \ - eza lsd bat btop dust duf prettyping most ripgrep lazygit lazydocker trash kitty wezterm + eza lsd bat btop dust duf prettyping ov 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 \ + curl-uv rustup-installer git-cargo-fish fisher-bootstrap curl-installer fzf-update "" "" paru-build yay-build \ wakatime-binary "" \ "" "" "" "" "" "" "" "" "" "" curl-lazydocker "" "" "" end diff --git a/functions/_fish_deps_install.fish b/functions/_fish_deps_install.fish index 03db4e3..c241935 100644 --- a/functions/_fish_deps_install.fish +++ b/functions/_fish_deps_install.fish @@ -100,6 +100,15 @@ function _fish_deps_install set -a methods special-paru set -a method_labels "build from AUR (makepkg)" end + case yay-build + if type -q paru + set -a methods special-paru-yay + set -a method_labels "paru -S yay" + end + if type -q pacman + set -a methods special-yay + set -a method_labels "build from AUR (makepkg)" + end case pipx if type -q pipx set -a methods special-pipx @@ -202,6 +211,15 @@ function _fish_deps_install end case special-yay-paru yay -S --noconfirm paru + case special-paru-yay + paru -S --noconfirm yay + case special-yay + set -l _build_dir (mktemp -d) + git clone https://aur.archlinux.org/yay.git $_build_dir + and pushd $_build_dir + and makepkg -si --noconfirm + and popd + rm -rf $_build_dir case special-paru set -l _build_dir (mktemp -d) git clone https://aur.archlinux.org/paru.git $_build_dir diff --git a/functions/_fish_deps_update.fish b/functions/_fish_deps_update.fish index 1ae31f7..6d4baae 100644 --- a/functions/_fish_deps_update.fish +++ b/functions/_fish_deps_update.fish @@ -28,6 +28,21 @@ function _fish_deps_update set -l pm_pkg $_fdc_pm[$i] set -l special $_fdc_special[$i] + # yay: update via paru if available, else system PM + if test "$special" = yay-build + if type -q paru + echo "Updating $bin..." + paru -S --noconfirm yay + set updated_any 1 + else 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) + continue + end + # cargo: update via rustup if test "$special" = rustup-installer if type -q rustup diff --git a/functions/poke.fish b/functions/poke.fish new file mode 100644 index 0000000..2a5a5f0 --- /dev/null +++ b/functions/poke.fish @@ -0,0 +1,17 @@ +# Copyright (C) 2026 Rootiest +# SPDX-License-Identifier: AGPL-3.0-or-later + +function poke --description 'touch with automatic parent directory creation' + if test (count $argv) -eq 0 + echo (set_color red)"poke: no file specified"(set_color normal) >&2 + return 1 + end + for _path in $argv + set -l _dir (dirname $_path) + if not test -d $_dir + mkdir -p $_dir + and echo (set_color --bold cyan)"Created: "(set_color cyan)"$_dir"(set_color normal) + end + touch $_path + end +end