summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/setup/nvim-lsp-installer.lua
diff options
context:
space:
mode:
authorAdam <56338480+adastx@users.noreply.github.com>2022-03-18 15:53:37 +0100
committerAdam <56338480+adastx@users.noreply.github.com>2022-03-18 15:53:37 +0100
commit4a05f21b62a6d9b91d00140089f4f9841989ceee (patch)
treea745bc2fbac08988627ba50d909cb2e1cd9c22ff /.config/nvim/lua/setup/nvim-lsp-installer.lua
parentebfbe6d30f1edb79dad337b274ff035447d51878 (diff)
nvim: better cmp lazy loading, lsp format on save
Diffstat (limited to '.config/nvim/lua/setup/nvim-lsp-installer.lua')
-rw-r--r--.config/nvim/lua/setup/nvim-lsp-installer.lua7
1 files changed, 6 insertions, 1 deletions
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 <buffer> lua vim.lsp.buf.formatting_sync()')
+ end,
+ }
-- (optional) Customize the options passed to the server
-- if server.name == "tsserver" then