

I have this in my config:
function lastcmd
echo $history[1]
end
abbr --add "!!" --position anywhere --function lastcmd
I believe I originally got this implementation from the GitHub issues. The key is that abbreviations can also call functions, which can in turn index into the history list. We also need to specify that we want the expansion even if we’re in an argument to another command, such as in sudo !!.


All of the 5 people who use (non-ESR) Firefox on their 2002 Pentium 4s will certainly be very unhappy about this.