Ctrl-R in bash and zsh is very useful. So is the !!
alias - which expands to the last command. I often find myself doing things like: cat file | !!
, before pressing tab to tweak the command. I would like to search my history incrementally when using !!
, but ctrl-R only seems to work at an empty prompt.
Is there a way to insert historic commands somewhere other than the beginning of a line?
Approaches tried:
I tried $(fc -nl | fzf) TAB
but this quoted the last command. I could use something like a zle plugin (like I used in this) but it feels like overkill...