I'm looking for a fast and efficient way to re-use the parameters of the last command in a new command. For example, in a Bash shell you can use the
$1 placeholder to reuse the 1st argument of the last command,
$! to reuse the last argument, etc. In a Fish shell you can use Alt-Up and Alt-Down keys to bring up the parameters of the complete history.
A regular use case is that I want to re-use parts of a file name I used in a previous command. If the file is still open, I could use Ctrl-R, % in the command line, but if I switched files, I have to open the command history, look for the command and copy the file name.
Ideally, I'd like to have an autocomplete-like key binding in the command line that allows me to skip though parts of the history just like I would skip through file names when hitting Tab.