If I run the following commands in bash:

mkdir foo
cd !$

The second command will be interpreted as cd foo and executed.

In zshell (at least with my current configuration), it will make the substitution, create the command cd foo, and leave my cursor at the end of it, so that I have to hit enter again to execute.

Is there a way to make it just execute the command?

link|improve this question

62% accept rate
feedback

1 Answer

From man zshoptions:

HIST_VERIFY

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.

So just add setopt no_hist_verify'to your .zshrc

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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