add NERDCustomDelimiters option

this allows users to override or specify delimiters for their own
filetypes outside of the script
This commit is contained in:
Martin Grenfell 2011-02-06 09:07:14 +13:00
parent 9f955640ee
commit 90cf828ac0

View File

@ -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