lsp fixes

This commit is contained in:
Rachel Lambda Samuelsson 2023-10-18 18:55:59 +02:00
parent e54fe9162c
commit 30ab66549f

View File

@ -100,7 +100,6 @@ in
videos = "${homeDir}/vid"; videos = "${homeDir}/vid";
}; };
programs = { programs = {
bash = { bash = {
enable = true; enable = true;
@ -158,18 +157,22 @@ in
require('Comment').setup() require('Comment').setup()
local lspcfg = require('lspconfig') local lspcfg = require('lspconfig')
lspcfg.typst_lsp.setup({ lspcfg.typst_lsp.setup({
cmd = { '${pkgs.typst-lsp}/bin/typst-lsp' } cmd = { '${pkgs.typst-lsp}/bin/typst-lsp' },
}) })
lspcfg.hls.setup({ lspcfg.hls.setup({
cmd = { '${hls_wrapper}', 'lsp' } cmd = { '${hls_wrapper}', 'lsp' },
}) })
lspcfg.pyright.setup({ lspcfg.pyright.setup({
cmd = { '${pkgs.nodePackages.pyright}/bin/pyright-langserver', '--stdio' } cmd = { '${pkgs.nodePackages.pyright}/bin/pyright-langserver', '--stdio' },
}) })
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args) callback = function(args)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = args.buf }) local opts = { buffer = args.buf }
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', '<localleader>r', vim.lsp.buf.rename, opts)
vim.keymap.set('n', '<localleader>a', vim.lsp.buf.code_action, opts)
vim.keymap.set('i', '<C-n>', vim.lsp.omnifunc, opts)
end, end,
}) })