Unlimited WordPress themes, graphics, videos & courses! Unlimited asset downloads! From $16.50/m
  1. Code
  2. Web Development

Vim Essential Plugin: SnipMate

This post is part of a series called Vim Essential Plugins.
Vim Essential Plugin: Sparkup
Vim Essential Plugin: Markdown to HTML

The SnipMate plugin aims to mimic the popular snippets feature in TextMate, which allows you to type a sequence of characters, and then automatically expand to a full block of code or html by pressing Tab. It's incredibly helpful.

Download the SnipMate Plugin


Once installed, you only need to type the desired snippet trigger, and then press Tab. Keep in mind, though, that the available snippets are limited to the extension of the file you're working on. For example, JavaScript snippets will not work within an HTML file, and vice versa.

Try visiting your ~.vim/snippets directory for an overview of all the available shortcut keys. You can even create your own!

If the above snippet is placed within the HTML.snippets file, you'll then be able to create a bla element by typing the shortcut, mysnippet.

Note: When creating new snippets, you'll need to either restart Vim, or open a new window before testing.

Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.