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

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

Expand Messages
  • thesheep
    Jan 3, 2007
    • 0 Attachment
      OK now I see that 'autoindent' *is* working, in accordance with the help
      page, in the sense that each new line copies the left indentation from the
      line above it. But I was hoping for something that automatically indents
      all the code intelligently, according to the html tags. Now I realise that
      I've been used to using gVIM on Windows, which seems to have that function.
      Is there any way to get that functionality in the terminal version of VIM?
      Sorry for confusion.



      thesheep wrote:
      >
      > I've now tried another machine, with a clean install of OSX Tiger. And
      > the same thing happens. Auto-indent sets all the HTML lines flush left.
      > I guess this is a default setting in OSX. But I can't understand why :set
      > shiftwidth=2 isn't changing this... any other OSX VIM users out there?
      > Thanks
      >
      >
      >
      > thesheep wrote:
      >>
      >> No change
      >>
      >>
      >> A.J.Mechelynck wrote:
      >>>
      >>> 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'.
      >>>>
      >>>> Any ideas?
      >>>
      >>> What happens if you use
      >>>
      >>> :filetype plugin indent on
      >>>
      >>> ?
      >>>
      >>>
      >>> Best regards,
      >>> Tony.
      >>>
      >>>
      >>
      >>
      >
      >

      --
      View this message in context: http://www.nabble.com/HTML-files-don%27t-auto-indent%2C-everything-else-does-tf2889782.html#a8142784
      Sent from the Vim - General mailing list archive at Nabble.com.
    • Show all 7 messages in this topic