diff --git a/ftplugin/lua.vim b/ftplugin/lua.vim index 3a53f25..2a573ce 100644 --- a/ftplugin/lua.vim +++ b/ftplugin/lua.vim @@ -94,6 +94,15 @@ if has('balloon_eval') call add(s:undo_ftplugin, 'setlocal ballooneval< balloonexpr<') endif +" Autocommands {{{1 +" Automatic commands to check for syntax errors and/or undefined globals +" and change Vim's "completeopt" setting on the fly for Lua buffers. +augroup PluginFileTypeLua + autocmd! + autocmd WinEnter call xolox#lua#tweakoptions() + autocmd BufWritePost call xolox#lua#autocheck() +augroup END + " }}}1 " Let Vim know how to disable the plug-in. diff --git a/plugin/lua-ftplugin.vim b/plugin/lua-ftplugin.vim index 05c6ce5..6164b76 100644 --- a/plugin/lua-ftplugin.vim +++ b/plugin/lua-ftplugin.vim @@ -29,14 +29,6 @@ endtry command! -bar LuaCheckSyntax call xolox#lua#checksyntax() command! -bar -bang LuaCheckGlobals call xolox#lua#checkglobals( == '!') -" Automatic commands to check for syntax errors and/or undefined globals -" and change Vim's "completeopt" setting on the fly for Lua buffers. -augroup PluginFileTypeLua - autocmd! - autocmd WinEnter * call xolox#lua#tweakoptions() - autocmd BufWritePost * call xolox#lua#autocheck() -augroup END - " Make sure the plug-in is only loaded once. let g:loaded_lua_ftplugin = 1