start rewrite nvim config for v0.11 from scratch
This commit is contained in:
parent
cbf59bea4b
commit
895b404943
9 changed files with 365 additions and 0 deletions
19
config/nvim_unstable/lua/aleidk/autocmds.lua
Normal file
19
config/nvim_unstable/lua/aleidk/autocmds.lua
Normal 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,
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue