mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-12 03:33:48 -05: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:
@@ -47,7 +47,7 @@ endfunction
|
|||||||
let s:spaceStr = ' '
|
let s:spaceStr = ' '
|
||||||
let s:lenSpaceStr = strlen(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:NERDAllowAnyVisualDelims", 1)
|
||||||
call s:InitVariable("g:NERDBlockComIgnoreEmpty", 0)
|
call s:InitVariable("g:NERDBlockComIgnoreEmpty", 0)
|
||||||
call s:InitVariable("g:NERDCommentWholeLinesInVMode", 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:NERDRPlace", "<]")
|
||||||
call s:InitVariable("g:NERDSpaceDelims", 0)
|
call s:InitVariable("g:NERDSpaceDelims", 0)
|
||||||
|
|
||||||
|
if !exists("g:NERDCustomDelimiters")
|
||||||
|
let g:NERDCustomDelimiters = {}
|
||||||
|
endif
|
||||||
|
|
||||||
let s:NERDFileNameEscape="[]#*$%'\" ?`!&();<>\\"
|
let s:NERDFileNameEscape="[]#*$%'\" ?`!&();<>\\"
|
||||||
|
|
||||||
let s:delimiterMap = {
|
let s:delimiterMap = {
|
||||||
@@ -374,6 +378,11 @@ let s:delimiterMap = {
|
|||||||
\ 'z8a': { 'left': ';' }
|
\ '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 mapping functions, autocommands and commands {{{1
|
||||||
" ============================================================================
|
" ============================================================================
|
||||||
" Section: Comment enabler autocommands {{{2
|
" Section: Comment enabler autocommands {{{2
|
||||||
|
|||||||
Reference in New Issue
Block a user