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

Re: [OT] favor request - for those of you that have html code folding working...

Expand Messages
  • Rick R
    On Wed, Dec 1, 2010 at 4:36 PM, Charles Campbell
    Message 1 of 3 , Dec 1, 2010
    • 0 Attachment
      On Wed, Dec 1, 2010 at 4:36 PM, Charles Campbell <Charles.E.Campbell@...> wrote:
        * syntax/html.vim does not support syntax folding.

       * xml does support folding, and its similar to html.

      I know html.vim doesn't support it by default, but I installed the newer xml.vim located here http://www.vim.org/scripts/script.php?script_id=1397 and created the sym links like it mentioned so that indent/html.vim pointed to indent/xml.vim.
       * Try editing an html file, and:
        :let g:xml_syntax_folding= 1
       :set ft=xml

      Cool Thanks! :set ft=xml did the trick! (I already had :let g:xml_syntax_folding= 1 in my .vimrc.) 

      Now that I know that trick I can turn on folding for html files when I need it. (most of the time I don't think I'll need it.. it's only in some large files.)

      As was pointed out, html is rather looser than xml and so its regions may not be well specified -- and then xml's folding (and probably other things) will then fail.

      True it is looser, but I'm making sure in my case that I'm using xhtml so that it's valid xml syntax so I should be ok.

      As an alternative, use  :set fdm=marker
      and put <!-- {{{1 -->  where you want folds.

      Thanks again! 

      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.