title: Simple Vim Programming (vimrc file)
body: <p>I'm trying to learn how to configure my .vimrc file with my own functions. </p>
  
  <p>I'd like to write a function that traverses every line in a file and counts the total number of characters, but ignores all whitespace.  This is for a programming exercise and as a stepping stone to more complex programs (I know there are other ways to get this example value using Vim or external programs).</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>function countchars()
      let line = 0
      let count = 0
      while line &lt; line("$")
          " update count here, don't count whitespace
          let line = getline(".")
      return count
  endfun
  </code></pre>
  
  <p>What functional code could I replace that commented line with?</p>