Vim: Counting the number of matches…

A useful trick in Vim to return the number of matched expressions in a file;

let x=0 | g/regexp/let x=x+1
echo x

where regexp obviously is the regular expression (pattern) you wish to count.

Explore posts in the same categories: Technical

2 Comments on “Vim: Counting the number of matches…”

  1. AnferTuto Says:

    Hola mardena!
    falikotrepat

  2. MalkEvange Says:

    Interesting article!
    Where can I find more on this theme?

Comment:

You must be logged in to post a comment.