Can the caret
^ and the sequence
\%V be used to match the beginning of a line in a visual selection? And if not, what is the rationale?
The following example seems to indicate that
\%V are not compatible, suggesting that visual selections do not include the beginning of the line, even if they are visual line selections that cover the whole line (i.e., selections started with
V). Consider a simple substitution command with the
n flag to count the number of blank lines in a visual selection.
:'<,'>s/\%V^$//ndoes not find any matches.
:'<,'>s/^$//nfinds every blank line in the visual selection.
Is this the expected behaviour? I find it a bit counter intuitive.