Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turning off automatic tag closing in emacs web mode?

Tags:

emacs

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?

like image 692
huwr Avatar asked May 01 '14 05:05

huwr


2 Answers

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

like image 41
qsun Avatar answered Nov 08 '22 18:11

qsun


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))
like image 83
Chris Avatar answered Nov 08 '22 20:11

Chris