diff options
| author | adikro <adikro@disroot.org> | 2026-03-01 19:57:16 +0100 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2026-03-01 19:57:16 +0100 |
| commit | 1be09af058424219de2aad4b9cc27ccf760d23f6 (patch) | |
| tree | bdc1177b166e1eef36763984b6862d7755a7bde8 /hm/shell/fish.nix | |
| parent | 4b41ce640c5eddcb50904331e03aac5460caa144 (diff) | |
...
Diffstat (limited to 'hm/shell/fish.nix')
| -rw-r--r-- | hm/shell/fish.nix | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/hm/shell/fish.nix b/hm/shell/fish.nix index d7f7248..20b9a95 100644 --- a/hm/shell/fish.nix +++ b/hm/shell/fish.nix @@ -13,14 +13,33 @@ in programs.fish = { enable = true; + functions = { + rga-fzf = { + body = '' + set -l RG_PREFIX "rga --files-with-matches --smart-case" + set -l file ( + FZF_DEFAULT_COMMAND="$RG_PREFIX '$argv[1]'" \ + fzf --sort \ + --preview='test -n {}; and rga --pretty --context 5 {q} {}' \ + --phony -q "$argv[1]" \ + --bind "change:reload:$RG_PREFIX {q}" \ + --preview-window="70%:wrap" + ) + + if test -n "$file" + echo "Opening $file..." + xdg-open "$file" + end + ''; + }; + }; + interactiveShellInit = '' set fish_greeting fastfetch ''; shellAliases = { - update = "git add . && git commit -m \"$1\" && nix flake update && nh os switch ."; - ns = "nix-search -p"; nd = "nix develop ."; nos = "nh os switch ."; @@ -60,10 +79,10 @@ in name = "pisces"; src = pkgs.fishPlugins.pisces.src; } - { - name = "fzf-fish"; - src = pkgs.fishPlugins.fzf-fish.src; - } + # { + # name = "fzf-fish"; + # src = pkgs.fishPlugins.fzf-fish.src; + # } { name = "fish-you-should-use"; src = pkgs.fishPlugins.fish-you-should-use.src; @@ -72,10 +91,10 @@ in name = "colored-man-pages"; src = pkgs.fishPlugins.colored-man-pages.src; } - { - name = "fifc"; - src = pkgs.fishPlugins.fifc.src; - } + # { + # name = "fifc"; + # src = pkgs.fishPlugins.fifc.src; + # } ]; }; }; |
