From f33f803371569bbaf527190b5cb7ab038bb1fe60 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 1 Apr 2024 14:29:26 +0200 Subject: fish: add !! shell alias for last history command --- user/settings/fish.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'user/settings') 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" = { -- cgit 1.4.1