title: How can I autoclose brackets in vim?
body: <p>I'm starting to do a lot of coding with vim, particularly C. While I've added some tricks to my vimrc file for code colour formatting, line numbers, etc., I'm wondering if there's a way to achieve the following functionality:</p>
  
  <p>This -</p>
  
  <pre><code>int main() {
  </code></pre>
  
  <p>becomes this -</p>
  
  <pre><code>int main() {
  
  }
  </code></pre>
  
  <p>Does anyone have any ideas or suggestions? I'll give anything a try as long as it saves me from forgetting another bracket ever again!</p>