Domanda

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?

È stato utile?

Soluzione

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))

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top