summary refs log tree commit diff stats
path: root/user/settings
diff options
context:
space:
mode:
authorAlan Pearce2024-04-01 14:29:26 +0200
committerAlan Pearce2024-04-01 14:29:26 +0200
commitf33f803371569bbaf527190b5cb7ab038bb1fe60 (patch)
treefa89e4e21d5c617df1c36650a15b4bf8e3ebc0ab /user/settings
parentb5e488c04c53845801239590552c8187ce954c4b (diff)
downloadnixfiles-f33f803371569bbaf527190b5cb7ab038bb1fe60.tar.lz
nixfiles-f33f803371569bbaf527190b5cb7ab038bb1fe60.tar.zst
nixfiles-f33f803371569bbaf527190b5cb7ab038bb1fe60.zip
fish: add !! shell alias for last history command
Diffstat (limited to 'user/settings')
-rw-r--r--user/settings/fish.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/user/settings/fish.nix b/user/settings/fish.nix
index c00e4fd1..8ed80e3e 100644
--- a/user/settings/fish.nix
+++ b/user/settings/fish.nix
@@ -42,8 +42,15 @@
       hist-freq-lines = lib.mkForce "history | sort | uniq -c | sort -gr | head -n100 | less";
       hist-freq-commands = lib.mkForce "history | cut -d' ' -f 1 | sort | uniq -c | sort -gr | head -n100 | less";
     };
+    shellAbbrs = {
+      "!!" = {
+        position = "anywhere";
+        function = "last_history_item";
+      };
+    };
     functions = {
       ds = "du -hd1 $argv[1] | sort -h";
+      last_history_item = "echo $history[1]";
     };
   };
   xdg.configFile."fish/completions" = {