Commit 8a68d179 authored by Adam Monsen's avatar Adam Monsen

improve markdown BufWritePost performance

The only functional change is adding the bang character within
MarkdownFileSettings. That ensures I don't run duplicate the autocommand
and run `silent make` twice upon saving a markdown file. This became
important when I swapped out `shred` for `rm` in my `mdfmt` script
(available in full the commit log message for
e2dbbbbd ).

I no longer need

  autocmd BufNewFile,BufRead *.md,*.markdown set filetype=markdown

because the plasticboy/vim-markdown plugin properly detects markdown
files with either extension.
parent 63485a4b
......@@ -471,12 +471,11 @@ function s:ChordFileSettings()
set virtualedit=all mouse=a
autocmd BufNewFile,BufRead *.md,*.markdown set filetype=markdown
autocmd FileType markdown call <SID>MarkdownFileSettings()
function s:MarkdownFileSettings()
set conceallevel=2
set makeprg=mdfmt\ %
autocmd BufWritePost *.md,*.markdown silent make
autocmd! BufWritePost *.md,*.markdown silent make
match todo /FIXME\|TODO/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment