Created
March 29, 2010 16:58
-
-
Save bogado/348104 to your computer and use it in GitHub Desktop.
vim modeline for setting fold-text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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