custom on_attach for every server #24
-
How would you go about extending the local lsp_opts = {
flags = {
debounce_text_changes = 150,
}
}
lsp.setup_servers({
'*', -- ANY SERVER
opts = lsp_opts
}) I was trying to integrate nvim-navic with lsp-zero. lsp-zero is lovely so far, thanks for sharing it ! |
Beta Was this translation helpful? Give feedback.
Answered by
VonHeikemen
Jun 27, 2022
Replies: 1 comment 1 reply
-
You can use the To use navic, you can try to create a buffer local variable and use that to control the function. local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.on_attach(function(client, bufnr)
if vim.b.lsp_attached then return end
vim.b.lsp_attached = true
require('nvim-navic').attach(client, bufnr)
end)
lsp.setup() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bugabinga
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the
.on_attach
function.To use navic, you can try to create a buffer local variable and use that to control the function.