From 5c21f1677180b76310a05e5a9fce46de64c23041 Mon Sep 17 00:00:00 2001 From: Rob Hurring Date: Sun, 8 May 2016 19:57:37 -0400 Subject: [PATCH] Allow toggling of syntax concealing (#99) Add `let g:markdown_syntax_conceal = 0` to your vimrc --- README.markdown | 4 ++++ syntax/markdown.vim | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 3660da3..cd79315 100644 --- a/README.markdown +++ b/README.markdown @@ -16,6 +16,10 @@ documents you can enable it in your `.vimrc` like so: let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] +To disable markdown syntax concealing add the following to your vimrc: + + let g:markdown_syntax_conceal = 0 + ## License Copyright © Tim Pope. Distributed under the same terms as Vim itself. diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 6aff90a..1b2a93a 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -81,7 +81,10 @@ syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" conta syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline -let s:concealends = has('conceal') ? ' concealends' : '' +let s:concealends = '' +if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1 + let s:concealends = ' concealends' +endif exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart' . s:concealends exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends