title: Vim BufWritePost not taking effect until vimrc is sourced manually on startup
body: <p>Using a minimal vimrc to remove trailing whitespace.</p>
  
  <pre><code>set list                            " show invisible characters
  set listchars=trail:·               " display extra whitespace
  
  autocmd BufWritePost &lt;buffer&gt; :%s/\s\+$//e
  </code></pre>
  
  <p>When I open a project and start working on a file with trailing white space when I save the file I expect it to be removed, but it doesn't get removed.</p>
  
  <p>When I source <code>.vimrc</code> manually and save the file it suddenly works.</p>
  
  <p>What is causing this and how do I solve it? </p>