From: BOACK Date: Sat, 13 Feb 2016 13:30:51 +0000 (+0900) Subject: Add 'g:vim_markdown_conceal' X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/8b54e061e105fba060d6c24c0a05679c2f951810?ds=sidebyside;hp=-c Add 'g:vim_markdown_conceal' Add variable 'g:vim_markdown_conceal' to enable/disable markdown conceal. In vimrc, let g:vim_markdown_conceal = 1 " conceal enable let g:vim_markdown_conceal = 0 " conceal disable Default : 1 --- 8b54e061e105fba060d6c24c0a05679c2f951810 diff --git a/README.md b/README.md index 6c043db..b3681a5 100644 --- a/README.md +++ b/README.md @@ -127,10 +127,10 @@ Concealing is set for some syntax. For example, conceal `[link text](link url)` as just `link text`. -To enable/disable conceal use Vim's standard conceal configuration. +To disable conceal, add the following to your '.vimrc': ```vim -set conceallevel=2 +let g:vim_markdown_conceal = 0 ``` ### Syntax extensions diff --git a/doc/vim-markdown.txt b/doc/vim-markdown.txt index 4b3d929..10d94d2 100644 --- a/doc/vim-markdown.txt +++ b/doc/vim-markdown.txt @@ -142,9 +142,9 @@ Concealing is set for some syntax. For example, conceal '[link text](link url)' as just 'link text'. -To enable/disable conceal use Vim's standard conceal configuration. +To disable conceal, add the following to your '.vimrc': > - set conceallevel=2 + let g:vim_markdown_conceal = 0 < ------------------------------------------------------------------------------- *vim-markdown-syntax-extensions* diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index 2f0c19f..c7832d7 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -658,7 +658,7 @@ function! s:MarkdownHighlightSources(force) let include = '@' . toupper(filetype) endif let command = 'syntax region %s matchgroup=%s start="^\s*```%s$" matchgroup=%s end="\s*```$" keepend contains=%s%s' - execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') ? ' concealends' : '') + execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) ? ' concealends' : '') execute printf('syntax cluster mkdNonListItem add=%s', group) let b:mkd_known_filetypes[ft] = 1 diff --git a/syntax/markdown.vim b/syntax/markdown.vim index becb12e..52369c3 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -36,7 +36,7 @@ syn sync linebreaks=1 let s:conceal = '' let s:concealends = '' -if has('conceal') +if has('conceal') && get(g:, 'vim_markdown_conceal', 1) let s:conceal = ' conceal' let s:concealends = ' concealends' endif