I’m migrating my blog to Jekyll and using MacVim to write my posts. I notice that I’m writing tags that look like this a lot:
{% highlight bash %}
chmod -R g+w test
{% endhighlight %}
or even…
{{ content }}
Is there a shortcut to insert the {{ }} or {% %} tags?
Note: I’m fairly new to Vim so any help is appreciated. I have Tim Pope’s Liquid plugin installed as well as the surround plugin.
You may want to take a look at ragtag by Tim Pope. It provides mappings like
<c-x>=for{{ foo }}and<c-x>-for{% foo %}.If you do not want ragtag and since you have surround installed you may want to create your own mappings. I suggest you create a
~/.vim/after/ftplugin/liquid.vimand put in the following:This will create surround mappings for
<c-s>=and<c-s>-just like ragtag.