Skip to content

Instantly share code, notes, and snippets.

@bogado
Created March 29, 2010 16:58
Show Gist options
  • Save bogado/348104 to your computer and use it in GitHub Desktop.
Save bogado/348104 to your computer and use it in GitHub Desktop.
vim modeline for setting fold-text
<!-- Search, using a regexp, for a text within the fold to set the fold text based on the match (in this case it folds divs on a html and uses the class and the first heading inside the div). -->
<!-- Procura, usando um regular expression, por um texto dentro do fold para setar o fold text baseado no resultado encontrado (neste caso ele está fazendos folds nos divs e usando a classe do div e o primeiro heading dentro do div -->
<!-- | fold marks | | folddashes|Substitute| Joins all the lines in the fold | Regular expression |Final text | | line count | -->
<!-- vim600:set fdm=marker fmr=<div,</div fdt=v\:folddashes.substitute(join(getline(v\:foldstart,v\:foldend),''),'.\\{-}<div\ class="\\(.\\{-}\\)".\\{-}<h\\d>\\(.\\{-}\\)<\/h\\d>.*','---\\1--\\2','')."\ [".string(v\:foldend-v\:foldstart+1)."\ lines]": -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment