I was wondering if it is possible to combine the gq
operation with other commands, as one might do with the |
operator. For example, it would be nice to be able to write a command like :'<,'>left4 |gq
. However, vim says that gq
in this context is not an editor command, because it is interpreting it as :gq
. Is there any workaround?
Add a comment
|
1 Answer
You can run normal mode commands from the command-line with the :normal
command.
In this instance, we want to first reselect the visual selection, and then run the gq
command:
:'<,'>left4 | norm! gvgq
See :help :normal
and :help gv
for more details.
-
Is there a way to do this with a global search & replace so you reindent as you go?– SteveMay 2, 2018 at 7:08
-
-