title: Vim: Mapping a key sequence that works in command-line mode
body: <pre><code>noremap &lt;C-S&gt; :update&lt;CR&gt;      
  vnoremap &lt;C-S&gt; &lt;ESC&gt;:update&lt;CR&gt;
  inoremap &lt;C-S&gt; &lt;ESC&gt;:update&lt;CR&gt;
  </code></pre>
  
  <p>These are the binds that I have set to get Vim to respond to a Ctrl+S by saving the buffer. I don't really use this, but this is very convenient for that short period of weaning on/off or interacting with other editors which we are all occasionally forced to put up with, and which invariably only provide that single bind for committing changes.</p>
  
  <p>Anyway, there are times, such as when Vim is in command-line mode (entering <code>:</code> command or <code>/</code> search) when pressing Ctrl+S will fail, even if I use a bind like this: </p>
  
  <pre><code>noremap! &lt;C-S&gt; &lt;ESC&gt;:update&lt;CR&gt;
  </code></pre>
  
  <p>It basically quits the command entry (apparently sending off the command or search, which is undesired also, even when I bind the <code>&lt;ESC&gt;</code>!) and fails to run <code>:update</code>.</p>
  
  <p>How can I make it work if I leave Vim in command line mode but still use the bind?</p>