start rewrite nvim config for v0.11 from scratch

This commit is contained in:
Alexander Navarro 2025-03-31 10:37:45 -03:00
parent cbf59bea4b
commit 895b404943
9 changed files with 365 additions and 0 deletions

View file

@ -0,0 +1,19 @@
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client then
return
end
-- Prefer LSP folding if client supports it
if client:supports_method('textDocument/foldingRange') then
local win = vim.api.nvim_get_current_win()
vim.wo[win][0].foldexpr = 'v:lua.vim.lsp.foldexpr()'
end
if client:supports_method 'textDocument/completion' then
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
end
end,
})