Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #64 from juanpabloaj/addFold

doc: modificated second example
  • Loading branch information...
commit b9e28043cc698a29f996d3d29fb6800be9993d04 2 parents 1302bb1 + e361252
@MarcWeber MarcWeber authored
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:
Please sign in to comment.
Something went wrong with that request. Please try again.