Does xhtml indent on tag names in vim 6.3.58

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Does xhtml indent on tag names in vim 6.3.58

David Herring

I'm asking this question again, as I'm sure it did work once okay for
me, but I must have lost some settings / configuration details...

Basically want to edit html/xhtml in vim, and want vim to indent the
file according the the <html> tags. I.E 4 spaces in for all lines
between matching tags.

So, lines between matching <div>  .. </div>'s are indented 4 spaces, e.g;-
<div>
   <p>stuff</p>
</div>

Currently typing gg=G to indent a whole file, causes all lines to be
left justified. I've tried movin my .vimrc file out of the way, still
same effect - no indenting on the xhtml tags.

Installed the following vim mapping for HTMl editing, but this did not
help with indenting ... http://www.infynity.spodzone.com/vim/HTML/

Is there some thing else to change / try ?

Thanks dave

--

David Herring
---
NetFM Ltd
T: 01344 769068
M: 07973 673027
---
http://www.journey2share.co.uk/
The number 1 trusted car share solution

Reply | Threaded
Open this post in threaded view
|

Re: Does xhtml indent on tag names in vim 6.3.58

David Herring

Problem solved....

I needed the following in my .vimrc:-

filetype plugin indent on

I think my problems where caused partly by blindly using other peoples
.vimrc files, without checking/understanding the need for this option.

thx dave



David Herring wrote:

>
> I'm asking this question again, as I'm sure it did work once okay for
> me, but I must have lost some settings / configuration details...
>
> Basically want to edit html/xhtml in vim, and want vim to indent the
> file according the the <html> tags. I.E 4 spaces in for all lines
> between matching tags.
>
> So, lines between matching <div>  .. </div>'s are indented 4 spaces,
> e.g;-
> <div>
>   <p>stuff</p>
> </div>
>
> Currently typing gg=G to indent a whole file, causes all lines to be
> left justified. I've tried movin my .vimrc file out of the way, still
> same effect - no indenting on the xhtml tags.
>
> Installed the following vim mapping for HTMl editing, but this did not
> help with indenting ... http://www.infynity.spodzone.com/vim/HTML/
>
> Is there some thing else to change / try ?
>
> Thanks dave
>


--

David Herring
---
NetFM Ltd
T: 01344 769068
M: 07973 673027
---
http://www.journey2share.co.uk/
The number 1 trusted car share solution