2

Some operations can be done with either normal-mode commands or ex/vimscript commands. For example, :resize 1 does the same thing as 1 <C-W> _.

In scripts, it's possible to simulate normal-mode commands with normal and execute, but it feels ugly to me. If I know the normal-mode command for an operation, but not the vimscript command, how do I find the latter? In some cases they're listed next to each other in the help, but not always.

1 Answer 1

3

There isn't always a corresponding Ex command for each Normal-mode command.

It's the case with all commands behind <C-w>, in fact there's :wincmd which gives you direct access to all of them, besides shortcuts such as :resize 1 (same as 1<C-w>_) or :split (same as <C-w>s) but, again, not all Normal-mode commands are exposed as Ex commands.

Sometimes, using :normal! is the way to do it.

If you have specific commands in mind, post about then, it might be easier to get more useful answers for specifically what you have in mind.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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