When editing html, vim applies different rules when inside certain tags (like script/pre/style). I want to have the normal html rules when inside a script tag (using handlebars, and I don't write any javascript in my html.).

Is there in a vim any way to disable this for the script tag and make it behave like a normal tag, so that I can get normal/html indentation rules inside a script tag.

I found something in ft-html-indent, but that only applies to indentation level of the first line. The indentation rules are not changed.

  • What do you put in your script tags? Its meant for js, so vim highlights it as such. Similarly style for css. Are you focused on only the indentation rules? Effectively the “filetype” is completely different inside those tags so you would need to disable that piece.
    – D. Ben Knoble
    May 22 '19 at 11:21
  • @D.BenKnoble For handlebars you need to write html inside a script tag. May 22 '19 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.