1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 12:50:04 +08:00
SpaceVim/config/plugins/nerdcommenter.vim

49 lines
1.3 KiB
VimL

scriptencoding utf-8
"
" nerd-commenter plugin settings
"
" Add extra space around delimiters when commenting, remove them when
" uncommenting
let g:NERDSpaceDelims = 1
let g:NERDCreateDefaultMappings = 0
" Always remove the extra spaces when uncommenting regardless of whether
" NERDSpaceDelims is set
let g:NERDRemoveExtraSpaces = 1
" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1
" Align line-wise comment delimiters flush left instead of following code
" indentation
let g:NERDDefaultAlign = 'left'
" Allow commenting and inverting empty lines (useful when commenting a
" region)
let g:NERDCommentEmptyLines = 1
" Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1
" Always use alternative delimiter
let g:NERD_c_alt_style = 1
let g:NERDCustomDelimiters = {'c': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }}
let s:ft = ''
fu! NERDCommenter_before()
if &ft ==# 'markdown'
let cf = context_filetype#get()
if cf.filetype !=# 'markdown'
let s:ft = 'markdown'
call NERDCommentSetUpForNewFiletype(cf.filetype)
endif
endif
endfu
fu! NERDCommenter_after()
if s:ft ==# 'markdown'
call NERDCommentSetUpForNewFiletype(s:ft)
let s:ft = ''
endif
endfu