title: How to automatically change keyboard layout on switch to vim normal-mode?
body: <p>Sometimes I use vim to write non-US text, and when I wanna use any command in normal mode, I need to change layout to US. It's possible to do that automatically?</p>
  
  <p>PS. I can do mapping like <a href="http://www.vim.org/scripts/script.php?script_id=3885" rel="noreferrer">this</a>, but in this case command looks like :ц instead :w - not pretty and typo-risk.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I don't want to use keymap option, because I prefer switch languages by CapsLock.
  I've try to write autocmd for InsertLeave event, but failed...</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>Probably anybody know, why the following not work?</p>
  
  <pre><code>function SetUsLayout()
    !setxkbmap us,ru
  endfunction
  
  autocmd InsertLeave * call SetUsLayout()
  </code></pre>