Thursday, January 22, 2009

How to count a particular word in VI?

If you want to count a particular word, say PROG, in a file, try this trick

:1,$s/zebra/&/g

or

if you want to count all words in a file, try

g [ctrl-g] at command mode

source: http://www.vim.org/tips/tip.php?tip_id=689

No comments: