In my file containing LaTeX source code, I wish to comment out all the lines matching a pattern (specifically, the pattern that I am interested in is \draw
, including the \
character).
I have magic
mode enabled. I think a potential solution would be to use the global
command i.e. something along the lines of
:g/\\draw/command
I am unsure of the command
that achieves my task. I would like to seek your help through either of the methods below:
I have Tim Pope's
commentary
plugin which provides thegc
mapping, which works in normal mode. However, this does not work inex
mode.Maybe use the normal mode
I
command and use the comment character for LaTeX (the percent%
character) on those lines matched by the global command.
Please let me know if a simpler alternative exists in addition to the ones mentioned above, I am of course glad to learn about it too!