summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/setup
diff options
context:
space:
mode:
authorAdam <56338480+adastx@users.noreply.github.com>2022-03-19 15:54:21 +0100
committerAdam <56338480+adastx@users.noreply.github.com>2022-03-19 15:54:21 +0100
commit2757854124db5f34af5d2010f0fb0ef6a6b9dcf4 (patch)
tree2a0b141dcc8c3d7a3d6988fb630d958f7ea7c553 /.config/nvim/lua/setup
parentab8266fb6218ceb160db64fe1573708b51273f9c (diff)
nvim: smarter use of autocmd
Diffstat (limited to '.config/nvim/lua/setup')
-rw-r--r--.config/nvim/lua/setup/nvim-lsp-installer.lua3
1 files changed, 3 insertions, 0 deletions
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! * <buffer>')
vim.cmd('autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()')
+ vim.cmd('augroup END')
end,
}