Question

When working with HTML templates in web mode I'm frustrated by the automatic closing of tags. When inside a <div> I type </ before it fills it in with div>.

This make copy/pasting from another place into my terminal annoying.

How do I turn off the feature?

Was it helpful?

Solution

This is controlled by the web-mode-tag-auto-close-style variable:

Tag auto-close style:
0=no auto-closing
1=auto-close with </
2=auto-close with > and </.

The default value is 1. Disable automatic tag closing completely with

(eval-after-load "web-mode"
  '(setq web-mode-tag-auto-close-style 0))

OTHER TIPS

To enable this feature:

(setq web-mode-enable-auto-closing t)

And to disable it:

(setq web-mode-enable-auto-closing nil)

Ref: https://github.com/fxbois/web-mode/issues/358

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top