mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-12-16 11:51:13 +01:00
neovim: Add more language servers
This commit is contained in:
parent
ae485beaf5
commit
162b3d0d13
@ -10,5 +10,9 @@
|
|||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
marksman
|
marksman
|
||||||
|
gopls
|
||||||
|
lua-language-server
|
||||||
|
clang-tools
|
||||||
|
texlab
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,6 @@
|
|||||||
rustc
|
rustc
|
||||||
rustfmt
|
rustfmt
|
||||||
cargo
|
cargo
|
||||||
|
rust-analyzer
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,35 @@
|
|||||||
{
|
{
|
||||||
plugin = nvim-lspconfig;
|
plugin = nvim-lspconfig;
|
||||||
type = "lua";
|
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;
|
plugin = nvim-base16;
|
||||||
|
Loading…
Reference in New Issue
Block a user