:%s/word/&/g
The above substitutes "word" for itself, and tells you the number of substitutions made.
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
:%s/word/&/g
You need to create an account or log in to post comments to this site.
» vi find/replaces for adding ... in regex sql vi vim findreplace subtitution
» count characters in ruby count
» Remove ^M characters using vi in vi
» Show line numbers in vi in vi
» C macro that implements coun... in c macro count count_if sum max max_elem
» shell/vim .rc's for Japanese... in shell osx terminal vim Japanese
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails