1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:40:06 +08:00

Comment code block in markdown (#2988)

close #2987
This commit is contained in:
Wang Shidong 2019-08-04 20:40:45 +08:00 committed by GitHub
parent b65651933f
commit 47a4b6baf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,3 +30,19 @@ let g:NERDTrimTrailingWhitespace = 1
" Always use alternative delimiter
let g:NERD_c_alt_style = 1
let g:NERDCustomDelimiters = {'c': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }}
let g:ft = ''
fu! NERDCommenter_before()
if &ft == 'markdown'
let g:ft = 'markdown'
let cf = context_filetype#get()
if cf.filetype !=# 'markdown'
exe 'setf ' . cf.filetype
endif
endif
endfu
fu! NERDCommenter_after()
if g:ft == 'markdown'
setf markdown
let g:ft = ''
endif
endfu