title: Refresh Vim buffer
body: <p>I'm editing HTML files.
  I use this keymap to launch firefox to preview the page:</p>
  
  <pre><code>map &lt;F6&gt; :update&lt;CR&gt;:silent !xdg-open %:p&lt;CR&gt;
  </code></pre>
  
  <p>But after this command, the Vim window becomes completely black.
  I need to scroll every line to make it appear again.</p>
  
  <p>So I want to write a function to fresh the buffer. Here's what i did:</p>
  
  <pre><code>function! Refresh()                                                                                                                                               
      " code
      set noconfirm
      bufdo e!
      set confirm
  endfunction
  
  nmap &lt;F5&gt; :call Refresh()&lt;CR&gt;
  </code></pre>
  
  <p>I got the idea from this <a href="https://stackoverflow.com/questions/1272007/refresh-all-files-in-buffer-from-disk-in-vim">post</a>.
  But it doesn't work.</p>