Quantcast
Channel: Active questions tagged user-commands - Vi and Vim Stack Exchange
Viewing all articles
Browse latest Browse all 60

Chaining user-defined commands [duplicate]

$
0
0

Assuming I have defined 2 commands in .vimrc

MultipleEmptyLinesToOneRemoveExcessiveSpaces

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.


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>