Permalink
Browse files

Merge pull request #64 from juanpabloaj/addFold

doc: modificated second example
  • Loading branch information...
2 parents 1302bb1 + e361252 commit b9e28043cc698a29f996d3d29fb6800be9993d04 @MarcWeber MarcWeber committed Dec 22, 2011
Showing with 11 additions and 3 deletions.
  1. +11 −3 doc/snipMate.txt
View
14 doc/snipMate.txt
@@ -125,9 +125,17 @@ Example 2: ~
Add to your ~/.vimrc: For each know snippet add a second version ending in _
adding folding markers
>
- fun! AddFolding(text)
- return "# {{{1\n".a:text."\n# }}}"
- endf
+ let g:commentChar = {
+ \ 'vim': '"',
+ \ 'c': '//',
+ \ 'cpp': '//',
+ \ 'sh': '#',
+ \ 'python': '#'
+ \}
+ " url https://github.com/garbas/vim-snipmate/issues/49
+ fun! AddFolding(text)
+ return substitute(a:text,'\n'," ".g:commentChar[&ft]." {{{\n",1)."\n".g:commentChar[&ft]." }}}"
+ endf
fun! SnippetsWithFolding(scopes, trigger, result)
" hacky: temporarely remove this function to prevent infinite recursion:

0 comments on commit b9e2804

Please sign in to comment.