summaryrefslogtreecommitdiff
path: root/hm/shell/fish.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hm/shell/fish.nix')
-rw-r--r--hm/shell/fish.nix39
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;
+ # }
];
};
};