Assuming I have defined 2 commands in .vimrc
MultipleEmptyLinesToOne
RemoveExcessiveSpaces
I can run them in command-line mode:
:exec "'<,'>MultipleEmptyLinesToOne" | exec "'<,'>RemoveExcessiveSpaces"
However this method doesn't support auto-completion while typing the commands.
I know that I can create a new user-defined command that runs them in a sequence:
command! -range RemoveExcessiveSpaces2 exec "'<,'>MultipleEmptyLinesToOne" | exec "'<,'>RemoveExcessiveSpaces"
but it would be still great to know whether I can type (chain) any user-defined commands in command-line mode and have auto-completion at the same time.
Q), type the first command,<ENTER>, then the second,<ENTER>again, and then get out withvisual. That way, you'll have autocompletion for the 2 commands – Zorzi Apr 26 '20 at 20:49-barwill let you chain them with|– D. Ben Knoble Apr 26 '20 at 20:52