Loading ...
Sorry, an error occurred while loading the content.
 

Re: HTML files don't auto indent, everything else does

Expand Messages
  • Charles E Campbell Jr
    ... Syntax highlighting is separate from indenting. What does vim abc.html ... show? If 0, indicates that indent/html.vim (or any indenting script) was not
    Message 1 of 7 , Jan 4, 2007
      thesheep wrote:

      >For some reason the auto-indent features aren't working with HTML source
      >files (and I want them to).
      >
      >I've tried these:
      >
      >:filetype indent on
      >:set autoindent
      >
      >I've also tried all these kinds of things:
      >
      >:set shiftwidth=2
      >:set softtabstop=2
      >
      >And then doing 'gg=G' to auto indent.
      >
      >It indents my javascript nicely, but all the HTML is just pushed hard left
      >without any indentation.
      >
      >HTML syntax is highlighted OK, so I guess the filetype thing is working.
      >
      >My .vimrc file is pretty much emtpy: just says 'syntax on'.
      >
      >
      Syntax highlighting is separate from indenting.

      What does

      vim abc.html
      :echo b:did_indent

      show? If 0, indicates that indent/html.vim (or any indenting script)
      was not loaded.
      Unfortunately, if its 1, that means that some indenting script was
      loaded (just not which one).

      Continuing: what does

      :echo &indentexpr

      show? That should be: HtmlIndentGet(v:lnum) if html indenting was loaded.

      Regards,
      Chip Campbell
    Your message has been successfully submitted and would be delivered to recipients shortly.