xjq233p_1
xjq233p_1

Reputation: 8060

Vim keeps messing up my javascript syntax within an html file

Indentation is all wrong. Any help?

I specifically use the following settings for javascript:

au FileType javascript set foldmethod=indent foldlevel=0 tabstop=2 softtabstop=2 shiftwidth=2 

How can I tell vim to identify a particular region within an .html file as javascript (thus applying those settings to that region)?

Thx

Upvotes: 1

Views: 639

Answers (1)

philwinkle
philwinkle

Reputation: 7056

As answered here: How do I fix incorrect inline Javascript indentation in Vim?

It's highly suggested you use the JavaScript Indent : Javascript indenter plugin

Upvotes: 2

Related Questions