diff options
author | Adam <56338480+adastx@users.noreply.github.com> | 2022-03-12 17:38:32 +0100 |
---|---|---|
committer | Adam <56338480+adastx@users.noreply.github.com> | 2022-03-13 17:58:45 +0100 |
commit | a429e351263d07e9d032cd9d5e820c675b790d9b (patch) | |
tree | 68da1ae8a7dcd74cfad254f8b8c7fcc33f1de855 /.config/nvim/lua/setup/nvim-lsp-installer.lua | |
parent | 5a908c6cbcdba880f7f267c9a238c492d021ac0c (diff) |
nvim: better lazy loading
Diffstat (limited to '.config/nvim/lua/setup/nvim-lsp-installer.lua')
-rw-r--r-- | .config/nvim/lua/setup/nvim-lsp-installer.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.config/nvim/lua/setup/nvim-lsp-installer.lua b/.config/nvim/lua/setup/nvim-lsp-installer.lua new file mode 100644 index 0000000..bd3496e --- /dev/null +++ b/.config/nvim/lua/setup/nvim-lsp-installer.lua @@ -0,0 +1,17 @@ +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 = {} + + -- (optional) Customize the options passed to the server + -- if server.name == "tsserver" then + -- opts.root_dir = function() ... end + -- end + + -- This setup() function will take the provided server configuration and decorate it with the necessary properties + -- before passing it onwards to lspconfig. + -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md + server:setup(opts) +end) |