From 5f770c34d3e1d23b4715f79fb67892d0263e1ae6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebasti=C3=A1n=20Mancilla?= Date: Fri, 2 Mar 2018 21:06:38 -0300 Subject: [PATCH 1/1] Make autocommands buffer-local Ensure the commands are executed only for Markdown buffers. --- ftplugin/markdown.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index 1078f3d..1aa3494 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -764,10 +764,10 @@ function! s:MarkdownClearSyntaxVariables() endfunction augroup Mkd - autocmd! - au BufWinEnter * call s:MarkdownRefreshSyntax(1) - au BufUnload * call s:MarkdownClearSyntaxVariables() - au BufWritePost * call s:MarkdownRefreshSyntax(0) - au InsertEnter,InsertLeave * call s:MarkdownRefreshSyntax(0) - au CursorHold,CursorHoldI * call s:MarkdownRefreshSyntax(0) + autocmd! * + autocmd BufWinEnter call s:MarkdownRefreshSyntax(1) + autocmd BufUnload call s:MarkdownClearSyntaxVariables() + autocmd BufWritePost call s:MarkdownRefreshSyntax(0) + autocmd InsertEnter,InsertLeave call s:MarkdownRefreshSyntax(0) + autocmd CursorHold,CursorHoldI call s:MarkdownRefreshSyntax(0) augroup END -- 2.39.5