From: Sebastián Mancilla Date: Sat, 3 Mar 2018 00:06:38 +0000 (-0300) Subject: Make autocommands buffer-local X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/5f770c34d3e1d23b4715f79fb67892d0263e1ae6?hp=-c Make autocommands buffer-local Ensure the commands are executed only for Markdown buffers. --- 5f770c34d3e1d23b4715f79fb67892d0263e1ae6 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