5 ms·
>I don't use !!, or !$, because I prefer to see what command is being executed before I press enter. I use zsh (with oh-my-zsh) and when I type e.g. "sudo !!"
by benvd 10y ago
>I don't use !!, or !$, because I prefer to see what command is being executed before I press enter.
I use zsh (with oh-my-zsh) and when I type e.g. "sudo !!" and press enter, it doesn't execute the command, instead it expands the !!. Another enter will then actually execute it.
I believe it's default behavior for oh-my-zsh. At least, I don't recall manually changing this.
- HeadlessChild 10y agoYou are correct.
- rdc12 10y agoI think by default in vanilla zsh, will expand something like 'sudo !!' by hitting tab after the second bang.
- posterboy 10y agoThis is achieved in bash by shopt -s histverify I don't use history expansions, though, so YMMV
- ssebastianj 10y agoSame behavior on zsh with prezto.
- jandrese 10y agoIn zsh you can type !!<tab> and it will auto-expand the line for you. I find histverify to be kind of annoying so I don't use it.
- Something1234 10y agoHow so?