mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-01-19 23:12:45 +08:00
add NERDCustomDelimiters option
this allows users to override or specify delimiters for their own filetypes outside of the script
This commit is contained in:
parent
9f955640ee
commit
90cf828ac0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user