commit 0b01d1ef6d081955d21ba7909e5f13c675677aa2
parent 2922329186b21216b18ef19c2406c61ae58d3bcd
Author: Thomas Vigouroux <tomvig38@gmail.com>
Date: Fri, 24 Sep 2021 09:14:05 +0200
feat(lsp): add nix lsp
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/after/plugin/mappings.vim b/after/plugin/mappings.vim
@@ -9,7 +9,7 @@ nnoremap <silent> yQ :cclose<CR>
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
-imap <expr> <TAB> v:lua.tab_complete()
+imap <expr> <Tab> v:lua.tab_complete()
snoremap <silent> <Tab> <cmd>lua require('luasnip').jump(1)<Cr>
imap <expr> <S-Tab> pumvisible() ? "\<C-P>" : "\<S-TAB>"
diff --git a/lua/completree-config.lua b/lua/completree-config.lua
@@ -47,6 +47,8 @@ comp.setup {
lua = lsp_completion,
rust = lsp_completion,
ocaml = lsp_completion,
+ python = lsp_completion,
+ nix = lsp_completion,
-- For git commit and text only do luasnip
gitcommit = s.luasnip,
diff --git a/lua/lsp_config.lua b/lua/lsp_config.lua
@@ -36,8 +36,8 @@ local function on_attach(client, bufnr)
vim.api.nvim_buf_call(bufnr, function()
vim.api.nvim_command [[autocmd CursorHold <buffer> lua vim.lsp.diagnostic.show_line_diagnostics{focusable = false}]]
- vim.api.nvim_command [[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]]
- vim.api.nvim_command [[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]]
+ vim.api.nvim_command [[autocmd CursorHold <buffer> lua pcall(vim.lsp.buf.document_highlight)]]
+ vim.api.nvim_command [[autocmd CursorMoved <buffer> lua pcall(vim.lsp.buf.clear_references)]]
end)
end
@@ -50,6 +50,7 @@ local default_lsps = {
'ghcide',
'pylsp',
'ocamllsp',
+ 'rnix',
}
for _,lname in ipairs(default_lsps) do