1

I was searching for solutions to autofold few types of files i'm using, mainly *.rb, *.scss, *.css, *.html and few other common languages.

However i can't find a solution to auto-fold a haml files. I've found those two topics but i'm not quite sure what the vimrc lines in those examples mean.

Have you any idea how can i achieve that? Any help would be appreciated:)

Community
  • 1
  • 1
mbajur
  • 4,406
  • 5
  • 49
  • 79

1 Answers1

1

you can customize it to your liking by manually editing a copy of the syntax file

  1. Copy $VIMRUNTIME/syntax/haml.vim into your $HOME/.vim/syntax/ or vimfiles/syntax/ folder to customize its behavior

  2. Modify it according to :help syn-fold (basically add the word "fold" at the end of syntax regions you want to fold)

  3. Put this in your .vimrc to use foldmethod=syntax when editing haml files

    autocmd BufRead,BufNewFile *.haml setlocal foldmethod=syntax

David Lam
  • 4,689
  • 3
  • 23
  • 34