From 689e513c5d84627efb7c65565c1787d3f5d601f6 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 19 Mar 2022 15:54:21 +0100 Subject: nvim: smarter use of autocmd --- .config/nvim/lua/setup/nvim-lsp-installer.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to '.config/nvim/lua/setup') diff --git a/.config/nvim/lua/setup/nvim-lsp-installer.lua b/.config/nvim/lua/setup/nvim-lsp-installer.lua index de086f0..a4322ba 100644 --- a/.config/nvim/lua/setup/nvim-lsp-installer.lua +++ b/.config/nvim/lua/setup/nvim-lsp-installer.lua @@ -6,7 +6,10 @@ lsp_installer.on_server_ready(function(server) local opts = { on_attach = function() vim.cmd('doautocmd User lspAttached') + vim.cmd('augroup Format') + vim.cmd('autocmd! * ') vim.cmd('autocmd BufWritePre lua vim.lsp.buf.formatting_sync()') + vim.cmd('augroup END') end, } -- cgit v1.2.3-70-g09d2