From 8b54e061e105fba060d6c24c0a05679c2f951810 Mon Sep 17 00:00:00 2001 From: BOACK Date: Sat, 13 Feb 2016 22:30:51 +0900 Subject: [PATCH] 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 --- README.md | 4 ++-- doc/vim-markdown.txt | 4 ++-- ftplugin/markdown.vim | 2 +- syntax/markdown.vim | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) 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 -- 2.39.5