From b78bbce3371a2eb56c89f618cd4ab2baadc9ee61 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 2 Apr 2022 15:40:07 -0400 Subject: [PATCH] Add recommended styles, per modern runtime file idiom Both the original spec on Daring Fireball and the more rigorous CommonMark spec state that a tab at the beginning of the line is synonymous with 4 spaces. For the record, I think this was a mistake, but if you can't beat 'em, join 'em. --- ftplugin/markdown.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index fbcde16..a40d14f 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -14,9 +14,13 @@ setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} if exists('b:undo_ftplugin') - let b:undo_ftplugin .= "|setl cms< com< fo< flp<" + let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<" else - let b:undo_ftplugin = "setl cms< com< fo< flp<" + let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<" +endif + +if get(g:, 'markdown_recommended_style', 1) + setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4 endif if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps")