This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your ~/.config/fish/config.fish | |
# Syntax: | |
# To just rerun your last command, simply type '!!' | |
# '!! sudo' will prepend sudo to your most recent command | |
# Running !! with anything other than sudo will append the argument to your most recent command | |
# To add another command to prepend list remove the # on line 10 and put the command in the quotes. Repeat as needed | |
function !!; | |
set prevcmd (history | head -n 1) | |
if test "$argv" | |
if test "$argv" = "sudo" #; or "any other command you want to prepend" |