title: Strategy to detect VIM mode?
body: <p>I aim to write a deamon which will change the lighting of my keyboard if VIM is in Insert Mode, or if VIM is in command mode.</p>
  
  <p>I am stuck on considering how I could extract the information about what mode VIM actually is in at any given time.  I have tried investigating all files in the /proc/ folder associated with a running VIM process, but have no found anything that could give insight as to what mode the editor currently is in.  </p>
  
  <p>I am aware that you can have VIM run a command with a setting in you ~/.vimrc as so:</p>
  
  <pre><code>autocmd InsertEnter * checktime
  </code></pre>
  
  <p>...but I am not sure how I could use this to programmatically (language is irrelevant right now) change state based on VIM mode.<br>
  Thank you.</p>