title: How to toggle automatic formatting with a single keybind in vim?
body: <p>I'm trying to toggle automatic formatting in vim (e.g. enable with <code>fo+=a</code> if not enabled, disable with <code>fo-=a</code> otherwise) with a single keybind like so:</p>
  
  <pre><code>nnoremap &lt;leader&gt;a "magic goes here"
  </code></pre>
  
  <p>I thought about using some exists check with conditionals but I couldn't find any. How can I do this?</p>