Sunday, November 28, 2010

Re: major confusion on vim folding behavior I'm seeing



On Sun, Nov 28, 2010 at 11:05 PM, Benjamin R. Haskell <vim@benizi.com> wrote:
 
You want foldmethod=syntax, not foldmethod=indent.

'indent' folds based on how far a given line is indented.  'syntax' folds based on syntax rules specific to the filetype being edited.

'indent' is really only useful (IMO) when you're editing something very, very simple that doesn't have a proper Vim 'syntax' set up.  Anything else usually has good defaults for folding via 'syntax' (or is configurable to do so).


Ok thanks. I had tried that but didn't have any luck. Kept saying "no fold found" when I swtiched to foldmethod=syntax. I'll have to go back and slowly build up a valid .vimrc that works.

Question: Ultimatley I want code folding in html files (and preferebly later haml/erb) should using foldmethod=sytnax work for any file that it recognizes the syntax?

Thanks again 

--
You received this message from the "vim_use" 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

No comments:

Post a Comment