How to Show the Full Count of Large Number of Search Occurrences instead of >99 in Vim
Sep 21, 2024
The aim of this page📝 is to get a count of matches in the whole file — complicated version — for many matches (over 100).
- Nick Janetakis, whom I found at a wonderful Changelog&Friends appearance (https://changelog.com/friends/53) introduced me to the
shortmess
- See https://nickjanetakis.com/blog/display-the-search-count-in-vims-status-bar
- But as pointed out in Reddit forum (vim/neovim seems same) “When searching a pattern with / or ? Neovim doesn’t show the full number of occurrences if there are more than 99 of them”
- Instead of another custom function in
.vimrc
, it is good to know%s###gn
- That returns something like
196 matches on 196 lines
instead of say[3/>99]
provided by default