The search-marks
command allows showing how many matches each line holds,
after a search was performed.
Interfacing command that takes a search primitive as first argument, which
can be any of the builtin primitives (/
, <a-/>
etc), or a custom mapping
declared by the user.
The command prompts the user for a pattern, which will be passed to
the search primitive upon validation of the prompt, and a flag-lines
highlighter added to the current window.
If no matches result from the search, the highlighter is removed from the window.
The following mappings override the builtin search primitives to use the markers command interface:
map -docstring 'search with markers' global normal '/' %{: search-marks /<ret>}
map -docstring 'backward search with markers' global normal '<a-/>' %{: search-marks <lt>a-/><ret>}
map -docstring 'extend search with markers' global normal '?' %{: search-marks ?<ret>}
map -docstring 'backward extend search with markers' global normal '<a-?>' %{: search-marks <lt>a-?><ret>}