preservim / vim-pencil

Rethinking Vim as a tool for writing
Other
1.57k stars 38 forks source link

Jekyll Code Blocks #72

Open thecliguy opened 5 years ago

thecliguy commented 5 years ago

I'm currently writing posts for a blog developed using Jekyll.

Posts are written in markdown, however code blocks use Jekyll's Liquid syntax. Code blocks are opened with {% highlight language-name %} and closed with {% endhighlight %}, EG:

{% highlight ruby %}
def foo
  puts 'foo'
end
{% endhighlight %}

I understand that vim-pencil's HardPencil mode has the ability to suspend formatting in code blocks. How can I instruct HardPencil mode to treat text surrounded by {% highlight language-name %} and {% endhighlight %} as a code block?