/vim-html-template-literals

Syntax highlighting for html template literals in javascript (as in lit-html and polymer 3)

Primary LanguageVim scriptMIT LicenseMIT

Syntax highlighting and indentation for lit-html. Largely inspired by vim-jsx.

Supported Syntaxes inside html`...`

  • HTML (including CSS embedded in <style> tags)
  • JavaScript string interpolation (${...})
  • nested templates (html`${html`${}`}`)

Installation

This plugin requires vim-javascript. If you use vim-plug for package management, installation looks like this:

Plug 'jonsmithers/experimental-lit-html-vim'
Plug 'pangloss/vim-javascript'

Note: it's generally a good idea to have let g:html_indent_style1 = "inc" in your vimrc for reasonable indentation of <style> tags. See :help html-indenting.

Known Issues

  • The indentation logic still has some kinks.
  • This plugin conflicts a bit with vim-jsx. Having both installed simultaneously may result in undesired indentation behaviors.