Pergunta

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?

Foi útil?

Solução

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

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top