From 90cf828ac0e6985480344dd9faebe949aed0b627 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 6 Feb 2011 09:07:14 +1300 Subject: [PATCH] add NERDCustomDelimiters option this allows users to override or specify delimiters for their own filetypes outside of the script --- plugin/NERD_commenter.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index 134101f..37108d1 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -47,7 +47,7 @@ endfunction let s:spaceStr = ' ' let s:lenSpaceStr = strlen(s:spaceStr) -" Section: variable init calls {{{2 +" Section: variable initialization {{{2 call s:InitVariable("g:NERDAllowAnyVisualDelims", 1) call s:InitVariable("g:NERDBlockComIgnoreEmpty", 0) call s:InitVariable("g:NERDCommentWholeLinesInVMode", 0) @@ -62,6 +62,10 @@ call s:InitVariable("g:NERDRemoveExtraSpaces", 1) call s:InitVariable("g:NERDRPlace", "<]") call s:InitVariable("g:NERDSpaceDelims", 0) +if !exists("g:NERDCustomDelimiters") + let g:NERDCustomDelimiters = {} +endif + let s:NERDFileNameEscape="[]#*$%'\" ?`!&();<>\\" let s:delimiterMap = { @@ -374,6 +378,11 @@ let s:delimiterMap = { \ 'z8a': { 'left': ';' } \ } +"merge in the custom delimiters +for ft in keys(g:NERDCustomDelimiters) + let s:delimiterMap[ft] = g:NERDCustomDelimiters[ft] +endfor + " Section: Comment mapping functions, autocommands and commands {{{1 " ============================================================================ " Section: Comment enabler autocommands {{{2