How do I make . execute the last shell command in zsh?

1

In bash, alias .= "fc -s" works for this purpose, it does exactly what I want. But in zsh, using fc -s just outputs fc: bad option: -s.

How do I make . execute the last shell command in zsh?

Accumulator

Posted 2017-11-14T01:25:56.090

Reputation: 87

Answers

1

alias .='fc -e -'

Instead of creating a separate alias, you could use the r builtin, which is equivalent to the above.

You could also use History Expansion: !!.

ZeroKnight

Posted 2017-11-14T01:25:56.090

Reputation: 408