From e36125289214ef6c72a890811b805b8716813b01 Mon Sep 17 00:00:00 2001 From: JuanPablo Date: Sun, 23 Oct 2011 16:39:34 -0300 Subject: [PATCH] doc: modificated second example --- doc/snipMate.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/snipMate.txt b/doc/snipMate.txt index 138bb654..583e6737 100644 --- a/doc/snipMate.txt +++ b/doc/snipMate.txt @@ -121,9 +121,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: