From 0c046544984a02b5a3fd7d4c035119e043d8d3e3 Mon Sep 17 00:00:00 2001 From: ervandew Date: Wed, 6 Feb 2013 07:54:06 -0800 Subject: [PATCH] add config support for default delims if there are no configured delims for the current filetype, allow the default delims to be defined by a global setting since c style comment delims are not always the best defaults for everyone. --- plugin/NERD_commenter.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugin/NERD_commenter.vim b/plugin/NERD_commenter.vim index d9225cc..d84aa70 100644 --- a/plugin/NERD_commenter.vim +++ b/plugin/NERD_commenter.vim @@ -441,6 +441,15 @@ function s:SetUpForNewFiletype(filetype, forceReset) endfunction function s:CreateDelimMapFromCms() + if exists('g:NERDDefaultDelims') + let delims = g:NERDDefaultDelims + for i in ['left', 'leftAlt', 'right', 'rightAlt'] + if !has_key(delims, i) + let delims[i] = '' + endif + endfor + return delims + endif return { \ 'left': substitute(&commentstring, '\([^ \t]*\)\s*%s.*', '\1', ''), \ 'right': substitute(&commentstring, '.*%s\s*\(.*\)', '\1', 'g'),