forked from tpope/vim-pathogen
/
markdown.vim
31 lines (26 loc) · 873 Bytes
/
markdown.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function! MarkdownEnableSyntaxRanges()
" source block syntax highlighting
if exists('g:loaded_SyntaxRange')
for lang in ['c', 'python', 'vim', 'javascript', 'cucumber', 'xml', 'typescript', 'sh', 'java', 'cpp', 'sh', 'php', 'yaml', 'css', 'html']
call SyntaxRange#Include(
\ '^```' . lang . '$'
\, '^```$'
\, lang, 'NonText')
endfor
" exception for text, since the syntax file is named nosyntax
call SyntaxRange#Include(
\ '^```text$'
\, '^```$'
\, 'plaintext', 'NonText')
call SyntaxRange#Include(
\ '^```$'
\, '^```$'
\, 'plaintext', 'NonText')
" exception for gherkin, since the syntax file is named cucumber
call SyntaxRange#Include(
\ '^```gherkin$'
\, '^```$'
\, 'cucumber', 'NonText')
endif
endfunction
call MarkdownEnableSyntaxRanges()