title: Vim: replacing text within function body
body: <p>I have some very useful plugins to find and replace text through files (see <code>EasyGrep</code> vim script - it's very helpful for programmers). I can even replace text only in the current buffer - by using plugins or <code>:%s ...</code>. But what if I just want replace text within the current function body?</p>
  
  <p>Consider the following example:</p>
  
  <pre><code>void f0()
  {
       int foo = 0;
       // ...
  }
  
  // 99 other functions that uses foo as local variable.
  
  void f100()
  {
       int foo = 0;  // I want to replace foo with bar only in this function
       // 1000 lines of code that uses foo goes below
       // ...
  }
  </code></pre>
  
  <p>Of course, I can use <code>:%s ...</code> with <code>c</code> flag for confirmation, but I believe there is a faster way to do this.</p>
  
  <p>Thanks.</p>