title: Vim pumvisible() call putting in random text
body: <p>I'm using the spf13 package for Vim. However, whenever I enter some text and press escape, some weird characters get appended to it.</p>
  
  <p>For example, if I type this and press escape,</p>
  
  <pre><code>hello
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>hellopumvisible() ? "\" : "\
  </code></pre>
  
  <p>There is a mapping on my .vimrc file that reads like this, which I think might be responsible:</p>
  
  <pre><code>" some convenient mappings
  inoremap &lt;expr&gt; &lt;Esc&gt;      pumvisible() ? "\&lt;C-e&gt;" : "\&lt;Esc&gt;"
  inoremap &lt;expr&gt; &lt;CR&gt;       pumvisible() ? "\&lt;C-y&gt;" : "\&lt;CR&gt;"
  inoremap &lt;expr&gt; &lt;Down&gt;     pumvisible() ? "\&lt;C-n&gt;" : "\&lt;Down&gt;"
  inoremap &lt;expr&gt; &lt;Up&gt;       pumvisible() ? "\&lt;C-p&gt;" : "\&lt;Up&gt;"
  inoremap &lt;expr&gt; &lt;C-d&gt;      pumvisible() ? "\&lt;PageDown&gt;\&lt;C-p&gt;\&lt;C-n&gt;" : "\&lt;C-d&gt;"
  inoremap &lt;expr&gt; &lt;C-u&gt;      pumvisible() ? "\&lt;PageUp&gt;\&lt;C-p&gt;\&lt;C-n&gt;" : "\&lt;C-u&gt;"
  </code></pre>
  
  <p>I guess it's taken from <a href="http://vim.wikia.com/wiki/Improve_completion_popup_menu" rel="noreferrer">http://vim.wikia.com/wiki/Improve_completion_popup_menu</a>. But for some reason, this is giving me odd behavior. Any advice?</p>
  
  <p><strong>EDIT:</strong>
  Here's the output of <code>:inoremap &lt;esc&gt;</code></p>
  
  <p><code>i  &lt;Esc&gt;       *@pumvisible() ? '&lt;C-E&gt;' : '&lt;C-R&gt;=&lt;SNR&gt;32_FlushBuffer()&lt;CR&gt;pumvisible() ? "\&lt;C-E&gt;" : "\&lt;Esc&gt;"'</code></p>
  
  <p><code>i  &lt;Esc&gt;       * pumvisible() ? "\&lt;C-E&gt;" : "\&lt;Esc&gt;"</code></p>
  
  <p>And I'm using Vim 7.3 on Windows 8.</p>
  
  <h2>Solution</h2>
  
  <p>The autoclose plugin is interfering with  mapping. I've written the steps to remove it here: <a href="http://crossplatform.net/dev/vim-spf13-writes-random-characters-when-pressing-escape.html" rel="noreferrer">http://crossplatform.net/dev/vim-spf13-writes-random-characters-when-pressing-escape.html</a>. It works fine now.</p>