From c72b5230b168e3481b4660b006bb7681c6aa54fa Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 18 Mar 2022 15:53:37 +0100 Subject: nvim: better cmp lazy loading, lsp format on save --- .config/nvim/lua/setup/nvim-lsp-installer.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to '.config/nvim/lua/setup/nvim-lsp-installer.lua') diff --git a/.config/nvim/lua/setup/nvim-lsp-installer.lua b/.config/nvim/lua/setup/nvim-lsp-installer.lua index bd3496e..de086f0 100644 --- a/.config/nvim/lua/setup/nvim-lsp-installer.lua +++ b/.config/nvim/lua/setup/nvim-lsp-installer.lua @@ -3,7 +3,12 @@ local lsp_installer = require("nvim-lsp-installer") -- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished -- or if the server is already installed). lsp_installer.on_server_ready(function(server) - local opts = {} + local opts = { + on_attach = function() + vim.cmd('doautocmd User lspAttached') + vim.cmd('autocmd BufWritePre lua vim.lsp.buf.formatting_sync()') + end, + } -- (optional) Customize the options passed to the server -- if server.name == "tsserver" then -- cgit v1.2.3-70-g09d2