New answers tagged range
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
Related Tags
range × 40search × 7
command-line × 6
vimscript × 4
visual-mode × 4
functions × 4
regular-expression × 3
cut-copy-paste × 3
normal-mode × 3
ex-mode × 3
ex-command × 3
key-bindings × 2
external-command × 2
register × 2
global-command × 2
count × 2
object-motions × 2
substitute × 1
insert-mode × 1
replace × 1
cursor-motions × 1
highlight × 1
folding × 1
formatting × 1
filetype-markdown × 1