Uses abbreviations in order to replicate the various bash bang commands. This has the advantage of replacing everything inline, so you can be more confident in using them.
!dnfreturns the last command that started with dnf!?abcreturns the last command that included abc!3returns the 3rd command used.!-3returns the 3rd most recent command used.!!returns the last command. Taken from the fish documentation!^returns the first argument of the last command!$returns the last argument of the last command!*returns all the arguments of the last command!:nreturns the nth argument of the last command
Installing with Fisher:
fisher install brewingweasel/fishbangInstalling with oh-my-fish should also work:
omf install https://github.com/BrewingWeasel/fishbangYou have two options:
-
Press space before enter
-
Rebind enter to also expand the abbreviation:
bind enter expand-abbr executeor (for vi keybinds):
bind -M insert enter expand-abbr executebind -M default enter expand-abbr execute