11 Commits

Author SHA1 Message Date
Scott Olsen
2723b93a33 Merge de0456245c into f9f845f28f 2024-12-28 10:15:03 +01:00
Kyoh
f9f845f28f Allow colons after language identifiers in fenced code blocks 2024-12-21 12:05:17 -05:00
Scott Olsen
de0456245c A few more cosmetic updates to README 2020-04-16 17:30:31 -04:00
Scott Olsen
a88cfb6fc2 Merge branch 'master' of https://github.com/tpope/vim-markdown into readme-update 2020-04-16 17:28:06 -04:00
Scott Olsen
5e1ac0ee60 Merge branch 'master' into readme-update 2019-04-16 17:28:02 -04:00
Scott Olsen
8946b2ecc1 Add section headers. 2018-10-22 15:23:08 -04:00
Scott Olsen
c74710e89b Add a configuration header. 2018-10-22 15:17:38 -04:00
Scott Olsen
d6012fe996 Make vimrc mentions consistent. Fix minor typos. 2018-10-22 15:16:45 -04:00
Scott Olsen
d7053febeb Update the fenced codeblocks documentation. 2018-10-22 15:09:43 -04:00
Scott Olsen
4831a1241c Update the minlines section content; typos, grammar, etc. 2018-10-22 15:04:09 -04:00
Scott Olsen
6f6ff4c922 Add documentation on enabling folding. 2018-10-22 15:00:39 -04:00
2 changed files with 28 additions and 10 deletions

View File

@@ -1,25 +1,43 @@
# Vim Markdown runtime files
This is the development version of Vim's included syntax highlighting and
filetype plugins for Markdown. Generally you don't need to install these if
filetype plugins for Markdown. Generally you don't need to install these if
you are running a recent version of Vim.
If you want to enable fenced code block syntax highlighting in your markdown
documents you can enable it in your `.vimrc` like so:
## Configuration
### Fenced code block highlighting
To enable fenced code block syntax highlighting in your markdown
documents, add the following to your `.vimrc`:
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
To disable markdown syntax concealing add the following to your vimrc:
**Note**: The fenced language names must be valid names of syntax files in vim's
`syntax` folder. For example: `syntax/ruby.vim`.
### Syntax concealment
To disable markdown syntax concealing, add the following to your `.vimrc`:
let g:markdown_syntax_conceal = 0
Syntax highlight is synchronized in 50 lines. It may cause collapsed
highlighting at large fenced code block.
In the case, please set larger value in your vimrc:
### Highlighting synchronization
Syntax highlighting is synchronized in 50 lines. This may cause collapsed
highlighting on large fenced code blocks.
In that case, set `g:markdown_minlines` to a larger value in your `.vimrc`:
let g:markdown_minlines = 100
Note that setting too large value may cause bad performance on highlighting.
**Note**: Setting `g:markdown_minlines` to a value that is too large value may
cause poor highlighting performance.
### Folding
To enable folding, add the following to your `.vimrc`:
let g:markdown_folding = 1
## License

View File

@@ -131,8 +131,8 @@ for s:type in g:markdown_fenced_languages
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
continue
endif
exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=[^[:space:]:]\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=[^[:space:]:]\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor
unlet! s:type