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

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

Expand Messages
  • Rick R
    I ve been struggling trying to get code folding working within HTML files in vim and macVim. All my other IDES (and various editors - textMate/komodoEdit)
    Message 1 of 3 , Dec 1, 2010
    • 0 Attachment
      I've been struggling trying to get code folding working within HTML files in vim and macVim. All my other IDES (and various editors - textMate/komodoEdit) support it so I'd like to have it working in vim and MacVim.

      Some on the vim list have been kind enough to try to help for a bit, but understandably they gave up.

      For someone that does have things working, is there any chance they could zip up their .vim dir and provide their .vimrc as well and I can start working with that to see where I've done things wrong? (I've been messing with both using foldmethod syntax and indent and having no luck. Installed xml plugin as well.)

      I've been trying all kinds of things to get things working. I've also put all my files out on github if someone wanted to take a look https://github.com/rickcr/vim

      --
      Rick R

      --
      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
    • Charles Campbell
      ... I think the situation is: * syntax/html.vim does not support syntax folding. * xml does support folding, and its similar to html. ... As was pointed out,
      Message 2 of 3 , Dec 1, 2010
      • 0 Attachment
        Rick R wrote:
        > I've been struggling trying to get code folding working within HTML
        > files in vim and macVim. All my other IDES (and various editors -
        > textMate/komodoEdit) support it so I'd like to have it working in vim
        > and MacVim.
        >
        > Some on the vim list have been kind enough to try to help for a bit,
        > but understandably they gave up.
        >
        > For someone that does have things working, is there any chance they
        > could zip up their .vim dir and provide their .vimrc as well and I can
        > start working with that to see where I've done things wrong? (I've
        > been messing with both using foldmethod syntax and indent and having
        > no luck. Installed xml plugin as well.)
        >
        > I've been trying all kinds of things to get things working. I've also
        > put all my files out on github if someone wanted to take a look
        > https://github.com/rickcr/vim
        I think the situation is:

        * syntax/html.vim does not support syntax folding.

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

        * Try editing an html file, and:
        :let g:xml_syntax_folding= 1
        :set ft=xml

        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.

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

        Regards,
        Chip Campbell

        --
        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
      • Rick R
        On Wed, Dec 1, 2010 at 4:36 PM, Charles Campbell
        Message 3 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.