diff options
| author | William Boman <william@redwill.se> | 2021-08-18 20:35:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-18 20:35:02 +0200 |
| commit | bb6c9441af692daf9b967a15324f574f601d4b52 (patch) | |
| tree | 853987daa609778bf3a64658f09eb0626d54ae7c /README.md | |
| parent | doc: add section for custom servers (diff) | |
| download | mason-bb6c9441af692daf9b967a15324f574f601d4b52.tar mason-bb6c9441af692daf9b967a15324f574f601d4b52.tar.gz mason-bb6c9441af692daf9b967a15324f574f601d4b52.tar.bz2 mason-bb6c9441af692daf9b967a15324f574f601d4b52.tar.lz mason-bb6c9441af692daf9b967a15324f574f601d4b52.tar.xz mason-bb6c9441af692daf9b967a15324f574f601d4b52.tar.zst mason-bb6c9441af692daf9b967a15324f574f601d4b52.zip | |
add new on_server_ready() API (#56)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -48,16 +48,14 @@ use { ### Setup ```lua -local lsp_installer = require'nvim-lsp-installer' +local lsp_installer = require("nvim-lsp-installer") function common_on_attach(client, bufnr) - -- setup buffer keymaps etc. + -- ... set up buffer keymaps, etc. end -local installed_servers = lsp_installer.get_installed_servers() - -for _, server in pairs(installed_servers) do - opts = { +lsp_installer.on_server_ready(function(server) + local opts = { on_attach = common_on_attach, } @@ -67,7 +65,8 @@ for _, server in pairs(installed_servers) do -- end server:setup(opts) -end + vim.cmd [[ do User LspAttachBuffers ]] +end) ``` For more advanced use cases you may also interact with more APIs nvim-lsp-installer has to offer, for example the following (refer to `:help nvim-lsp-installer` for more docs): |
