Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently made the switch from bash to zsh. I discovered two minuscule issues and differences between zsh and bash. I was slightly disappointed when my favorite two shortcuts !! & !$ don't behave as they do in bash.

When I try to the following with the argument shortcuts (sorry I don't know what they're formally called) they would automatically execute like the following in bash:

$ touch foo
$ vim !$
<file opens immediately>

While in zsh they become translated then executed (I have to hit enter one extra time):

$ touch foo
$ vim !$
$ vim foo

Is there a way to have !$ & !!, in zsh, behave the same way as it does in bash?

share|improve this question
up vote 9 down vote accepted

From man zshoptions

    Whenever the user enters a line with history expansion,  don't  execute  the  line
    directly;  instead, perform history expansion and reload the line into the editing buffer.

To disable this option run setopt no_hist_verify. You can also have a look at your config file and remove the hist_verify option or just explicitly disable it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.