To count occurrences of a word in vim run following expression:
Here I am opening a file with vim editor and calculating number occurrences of a word “done”.
It will display count in status line without changing buffer. This expression is supported by recent versions of vim only.
In older versions of vim use following expression:
This expression will edit file and shows us count. After viewing count in status line press u to undo changes.