nixvim-config/config/plugins/lsp.nix

85 lines
1.6 KiB
Nix
Raw Permalink Normal View History

{pkgs, ...}: {
2024-06-01 06:32:58 +00:00
plugins.lsp = {
enable = true;
2024-06-01 14:57:37 +00:00
keymaps.extra = [
{
action = "<cmd>LspStop<CR>";
key = "<leader>lx";
}
{
action = "<cmd>LspStart<CR>";
key = "<leader>ls";
}
{
action = "<cmd>LspRestart<CR>";
key = "<leader>lr";
}
2024-06-03 23:32:54 +00:00
{
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";
}
2024-06-01 14:57:37 +00:00
];
2024-06-03 23:32:54 +00:00
keymaps.lspBuf = {
"K" = "hover";
"gD" = "references";
"gd" = "definition";
"gi" = "implementation";
};
2024-06-01 06:32:58 +00:00
servers = {
# python
ruff.enable = true;
2024-06-02 17:41:22 +00:00
pyright.enable = true;
2024-06-01 06:32:58 +00:00
2024-06-09 05:09:30 +00:00
# bash
bashls.enable = true;
2024-06-01 06:32:58 +00:00
2024-07-09 23:00:36 +00:00
# json
jsonls.enable = true;
2024-07-13 16:54:59 +00:00
# yaml
yamlls.enable = true;
2024-07-10 05:38:14 +00:00
# css
cssls.enable = true;
2024-06-16 03:40:57 +00:00
# c++
clangd.enable = true;
2024-09-02 05:47:23 +00:00
# elixir
elixirls.enable = true;
2024-11-17 00:27:29 +00:00
terraformls.enable = true;
tflint.enable = true;
# rust
rust_analyzer = {
enable = true;
# Rely on tooling from dev environment
package = null;
installCargo = false;
installRustc = false;
};
2024-06-01 06:32:58 +00:00
# nix
nixd = {
enable = true;
settings.formatting.command = ["${pkgs.alejandra}/bin/alejandra"];
};
2024-06-01 06:32:58 +00:00
};
};
plugins.lsp-format.enable = true;
plugins.lsp-lines.enable = true;
2024-06-01 06:32:58 +00:00
}