title: Remap Esc in Command Line Mode for Vim
body: <p>I want to use <code>&lt;leader&gt;e</code> to return to normal mode from whatever mode I am in. For insert mode I use</p>
  
  <pre><code>inoremap &lt;leader&gt;e &lt;esc&gt;
  </code></pre>
  
  <p>I wanted the same thing to exit command line mode, so I wrote</p>
  
  <pre><code>cnoremap &lt;leader&gt;c &lt;esc&gt;
  </code></pre>
  
  <p>However, when it exits command line mode, it tries to execute whatever what written past the command line. However, when I just use <code>&lt;esc&gt;</code> normally, it exists command line mode without executing anything. I usually have to press <code>&lt;enter&gt;</code> to execute the command.</p>
  
  <p>Can anyone help me understand what is going on here, and what I can do to get the behavior I want.</p>
  
  <p>Thanks!</p>