nixvim-config/config/plugins/lsp.nix
Alejandro Angulo 2cc7060fc4
Removed type definition shortcut
Shortcut conflicted with default shortcuts for switching tabs :(
2024-06-04 11:08:54 -07:00

61 lines
1.2 KiB
Nix

{pkgs, ...}: {
plugins.lsp = {
enable = true;
keymaps.extra = [
{
action = "<cmd>LspStop<CR>";
key = "<leader>lx";
}
{
action = "<cmd>LspStart<CR>";
key = "<leader>ls";
}
{
action = "<cmd>LspRestart<CR>";
key = "<leader>lr";
}
{
action = "<cmd>split | lua vim.lsp.buf.definition()<CR>";
key = "gs";
}
{
action = "<cmd>vsplit | lua vim.lsp.buf.definition()<CR>";
key = "gv";
}
{
action = "<cmd>tab split | lua vim.lsp.buf.definition()<CR>";
key = "gn";
}
];
keymaps.lspBuf = {
"K" = "hover";
"gD" = "references";
"gd" = "definition";
"gi" = "implementation";
};
servers = {
# python
ruff.enable = true;
pyright.enable = true;
# lua (nvim config)
lua-ls.enable = true;
# ocaml
ocamllsp.enable = true;
# nix
nixd = {
enable = true;
settings.formatting.command = ["${pkgs.alejandra}/bin/alejandra"];
};
};
};
plugins.lsp-format.enable = true;
plugins.lsp-lines.enable = true;
}