Vim Essential Plugin: Sparkup

The sparkup plugin, inspired by the popular ZenCoding, allows you to rapidly create HTML structures. It's an essential tool in your Vim handbag!


Usage

Sparkup is incredibly easy to use. Let's review a handful of use cases.

1. Create an Unordered List of Links

Output

Note that we can create nested elements by using the > symbol. Additionally, to create multiple elements of the same type, use the * symbol (think multiply). Lastly, we can set the value of each element by wrapping a string within curly braces.

2. Create a Basic Website Structure

Output

This time, we're using the < symbol to travel back up the chain. This allows us to create nested HTML structures, and then return to the top of the chain to further create sibling elements.

3. Apply Attributes to Elements

Output

Attributes can be applied to elements by placing them within brackets ([). If you omit the value -- like, a[href], you can then manually insert it after expansion. In MacVim, you can use the Control + N and Control + P shortcuts to toggle between the next and previous stop points.

Tags:

Comments

Related Articles