New answers tagged

2

Reading through the documentation I found the answer. This is not related to the global command but mainly due to cmdline-ranges operating on the NEXT line matching the pattern rather than same or next line which I originally thought. :h cmdline-ranges /{pattern}[/] the next line where {pattern} matches *:/* So running :g/<li>/.,/<\/li>...


2

When you have / characters in your pattern is is better to use another separator, for instance | (see :help :g). I am guessing that too many separators are confusing the parsing engine. The following command will do what you want with the example you gave (the <li> elements are all on a single line) :g|<li>.*</li>|p Here I am using | as a ...


Top 50 recent answers are included