So you're referring to the search results that get highlighted when you have the
'hlsearch' option set. So, in effect, these are the search results.
Your example has one more quirk to it, which is the fact that you're ending with a
\zs, so in effect what Vim is highlighting there is the character following the search term and not the match itself (highlighted the match would not be possible, since it has zero length, so it would be invisible.)
But assuming you're using a search that has matches with a length, such as:
Then the question is how to manipulate them, perform and action on them.
You asked about Visual mode. In Vim, Visual mode is a contiguous block of text, so you couldn't really use a single Visual selection on all your matches. In theory, it should be possible to use a Visual selection for each match, one at a time, so you could manipulate it and move on to the next selection.
If going through the matches one by one is acceptable, then what you want is the
gn operator, which will find the next match (much like the
n motion does), but it will start Visual mode and select the match itself.
:help gn explains it:
Search forward for the last used search pattern, like with
n, and start Visual mode to select the match. If the cursor is on the match, visually selects it. If an operator is pending, operates on the match. E.g.,
dgndeletes the text of the next match. If Visual mode is active, extends the selection until the end of the next match.
I'd say the more general answer to the question of "how to perform an action on search matches" is to use the
: substitute) command, which takes a pattern and substitutes matches with a replacement.
You can even omit the pattern, with
:s// followed by a replacement, in which case Vim will use the most recently used pattern, which is the one highlighting the matches on your text. So if you start with a search and decide you want to act on those results, you can simply use
:%s// and follow it with a replacement.
There are special replacements that you can use.
For starters, some characters are special, see
:help sub-replace-special which will tell you how
& will be replaced by the matched pattern and
\U will turn the next string into uppercase.
So to turn the matches of your previous search into uppercase, you could use:
The special characters and backslash sequences can take you so far, but sometimes you might need more than them. In those cases, you can use full Vimscript expressions. See
:help sub-replace-expression, which describes how to use them.
For the same example, of turning the matches into uppercase:
This should take care of even more complex cases, assuming you're willing to learn more on Vimscript functions and expressions to help you express complex substitutions.