neovim: Add more language servers

This commit is contained in:
Donovan Glover 2023-05-23 17:12:35 -04:00
parent ae485beaf5
commit 162b3d0d13
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
3 changed files with 34 additions and 1 deletions

View File

@ -10,5 +10,9 @@
environment.systemPackages = with pkgs; [
marksman
gopls
lua-language-server
clang-tools
texlab
];
}

View File

@ -6,5 +6,6 @@
rustc
rustfmt
cargo
rust-analyzer
];
}

View File

@ -102,7 +102,35 @@
{
plugin = nvim-lspconfig;
type = "lua";
config = "require'lspconfig'.nil_ls.setup{}";
config = "
local lspconfig = require('lspconfig')
lspconfig.nil_ls.setup {}
lspconfig.rust_analyzer.setup {}
lspconfig.marksman.setup {}
lspconfig.gopls.setup {}
lspconfig.lua_ls.setup {}
lspconfig.clangd.setup {}
lspconfig.texlab.setup {}
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
end,
})
";
}
{
plugin = nvim-base16;