In zsh
in vim mode
, I write something
foo foo bar bar
Then I hit Esc to go in normal mode and type :
foo foo bar bar
execute: _
Then, I assume I can do that, I want to search and replace bar
with baz
foo foo bar bar
execute: s/bar/baz/g_
Then I try to hit Enter, but that doesn't work. I can only go back from the execute
using Ctrl+c.
How can I execute the command?
I tried this with my normal .zshrc
and without any .zshrc
at all.
Best Answer
The
vicmd
mode, despite the name, is for Vi's normal-mode commands. The prompt started by:
isn't for Vi's ex-mode commands, but for running ZLE (Zsh's line editor) commands:Pressing Enter will work when a unique prefix has been entered (i.e, say you type
ed
, which matchesedit-command-line
, then Enter will work). You can press Tab to see matching commands.