I just started working with Jekyll, which uses Liquid. As a templating language, Liquid is embedded into files of other types (e.g., HTML, CSS, or Markdown). Vim handles this sort of dual syntax highlighting admirably – when set filetype=liquid
in, say, an HTML file, it preserves the HTML highlighting while additionally highlighting Liquid code.
But Liquid also has its own comment markers, which are distinct from HTML's, CSS's, and Markdown's. And when I want to comment something out in a .css.liquid
file, more often than not, what I'm trying to do is make a /* CSS comment */
, not a {{ comment }}Liquid comment{{ endcomment }}
.
Unfortunately, I rely on tpope’s vim-commentary to comment stuff out, and that plugin relies on the filetype-specific commentstring
setting to determine how to wrap comments.
So my question is, is there any way to enable Liquid syntax highlighting while keeping the native commentstring
setting?