nixvimConfigs/fiesta/setups/lsp: init

This commit is contained in:
Gabriel Arazas 2024-02-03 21:26:52 +08:00
parent d800232d18
commit 7ee0e6321a
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 43 additions and 0 deletions

View File

@ -9,6 +9,7 @@
ui.enable = true;
completion.enable = true;
treesitter.enable = true;
lsp.enable = true;
fuzzy-finder.enable = true;
debugging.enable = true;
desktop-utils.enable = true;

View File

@ -4,6 +4,7 @@
./setups/debugging.nix
./setups/desktop-utils.nix
./setups/fuzzy-finder.nix
./setups/lsp.nix
./setups/note-taking.nix
./setups/snippets
./setups/treesitter.nix

View File

@ -0,0 +1,41 @@
{ config, lib, ... }:
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 {
plugins.lsp.enable = true;
# Keymaps for moving around in the buffer.
plugins.keymaps.lspBuf = {
K = "hover";
gD = "references";
gd = "definition";
gi = "implementation";
gt = "type_definition";
};
# Keymaps for moving around with the doctor.
plugins.keymaps.diagnostic = {
"<leader>j" = "goto_next";
"<leader>k" = "goto_prev";
};
# Enable lsp-format
plugins.lsp-format.enable = true;
# Make those diagnostics fit the screen, GODDAMNIT!
plugins.lsp-lines.enable = true;
};
}