title: Vim ftplugin executes c.vim instead of cpp.vim for C++ files
body: <p>I am learing Vim and I want have set it up as IDE by mapping F5 key to compilation command which is decided by the filetype.</p>
  
  <p>My <code>~/.vim/ftplugin/c.vim</code>:</p>
  
  <pre><code>map &lt;F5&gt; :w&lt;CR&gt;:!clang % -o %:r.out &amp;&amp; ./%:r.out&lt;CR&gt;
  </code></pre>
  
  <p>My <code>~/.vim/ftplugin/cpp.vim</code>:</p>
  
  <pre><code>map &lt;F5&gt; :w&lt;CR&gt;:!clang++ -ggdb -pthread -std=c++11 % -o %:r.out &amp;&amp; ./%:r.out&lt;CR&gt;
  </code></pre>
  
  <p>When I open a C++ file (with <code>.cpp</code> extension) and hit F5, the command from <code>c.vim</code> is executed. Why is this happening?</p>
  
  <p>When I remove the file <code>c.vim</code>, then Vim loads <code>cpp.vim</code> and works as expected.</p>