2025-01-21 05:37:11 +00:00
|
|
|
{ config, lib, helpers, ... }:
|
2024-02-03 13:26:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
nixvimConfig = config.nixvimConfigs.fiesta;
|
|
|
|
cfg = nixvimConfig.setups.lsp;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.nixvimConfigs.fiesta.setups.lsp.enable =
|
|
|
|
lib.mkEnableOption null // {
|
|
|
|
description = ''
|
|
|
|
Whether to enable LSP setup. Take note you'll have to enable and
|
|
|
|
configure individual language servers yourself since the resulting
|
|
|
|
NixVim config can be pretty heavy.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2025-01-21 05:37:11 +00:00
|
|
|
keymaps = [
|
|
|
|
{
|
|
|
|
mode = [ "n" ];
|
|
|
|
key = "<leader>Li";
|
|
|
|
options.desc = "Toggle inlay hints";
|
|
|
|
action = helpers.mkRaw ''
|
|
|
|
function()
|
|
|
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-08-03 00:52:10 +00:00
|
|
|
plugins.lsp = {
|
|
|
|
enable = true;
|
|
|
|
inlayHints = true;
|
|
|
|
};
|
2024-02-03 13:26:52 +00:00
|
|
|
|
|
|
|
# Keymaps for moving around in the buffer.
|
2024-02-04 11:48:21 +00:00
|
|
|
plugins.lsp.keymaps.lspBuf = {
|
2024-02-03 13:26:52 +00:00
|
|
|
K = "hover";
|
|
|
|
gD = "references";
|
|
|
|
gd = "definition";
|
|
|
|
gi = "implementation";
|
|
|
|
gt = "type_definition";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Keymaps for moving around with the doctor.
|
2024-02-04 11:48:21 +00:00
|
|
|
plugins.lsp.keymaps.diagnostic = {
|
2024-02-03 13:26:52 +00:00
|
|
|
"<leader>j" = "goto_next";
|
|
|
|
"<leader>k" = "goto_prev";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Make those diagnostics fit the screen, GODDAMNIT!
|
|
|
|
plugins.lsp-lines.enable = true;
|
|
|
|
};
|
|
|
|
}
|