3

I'm a recent convert to zsh (from bash).

In zsh, as in bash, there is the history expansion feature.

For example, you can do:

git blame somefile.cc
vim !$

Here, vim !$ is same as typing out the full file name vim somefile.cc.

However, in zsh, after I type vim !$, zsh shows me the expanded command vim somefile.cc (as if to confirm with me what I have typed) and I have to hit the return again to actually execute it.

In bash, after type vim !$ and hit return, I'm in the vim editor.

Is it possible to configure zsh so it behaves like bash in this scenario (ie avoiding having to type an extra carriage return)?

Thank you.

Zack Xu
  • 133
  • 3

1 Answers1

2

Add the following line to your .zshrc (or anything source'd there):

unsetopt HIST_VERIFY
Burnus
  • 166
  • 8