title: How to create short snippets in Vim?
body: <p>I have recently started using Vim as my text editor and am currently working on my own customizations.</p>
  
  <p>I suppose keyboard mappings can do pretty much anything, but for the time being I'm using them as a sort of snippets facility almost exclusively.</p>
  
  <p>So, for example, if I type <code>def{TAB}</code> (<code>:imap def{TAB} def ():&lt;ESC&gt;3ha</code>), it expands to:</p>
  
  <pre><code>def |(): # '|' represents the caret
  </code></pre>
  
  <p>This works as expected, but I find it annoying when Vim waits for a full command while I'm typing a word containing "def" and am not interested in expanding it.</p>
  
  <ul>
  <li>Is there a way to avoid this or use this function more effectively to this end?</li>
  <li>Is any other Vim feature better suited for this?</li>
  </ul>
  
  <hr>
  
  <p>After taking a quick look at <a href="http://www.vim.org/scripts/script.php?script_id=1318" rel="noreferrer">SnippetsEmu</a>, it looks like it's the best option and much easier to customize than I first thought.</p>
  
  <p>To continue with the previous example:</p>
  
  <pre><code>:Snippet def &lt;{}&gt;():
  </code></pre>
  
  <p>Once defined, you can expand your snippet by typing <code>def{TAB}</code>.</p>