To get the count of a string I usually do something a bit hack-ish such as the following:
Do a
:%s
ubstitution on the string in question, such as:# how many times does the string "<Item " occur in the file? :%s/\<Item //g
Read the output:
2009 substitutions on 2009 lines
Do an undo to go back to the original state of things.
u
Is there a more straightforward way to get the count of occurrences of a string in vim?
searchcount()
work for you? – Mass Feb 9 at 20:13