From baae94abb6a9a03914216f0f373b7b0f6b0207bd Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sat, 19 Sep 2026 01:40:50 +0530 Subject: chore: removed all raw string configurations options in favor of files Moved all configurations which were previously raw strings chunks, for options that the home-manager options didn't provide, into files for that specific configuration and reading there contents instead (with string replacement for passing information from the rest of the configuration). --- modules/development/nixvim/plugins/lsp/default.nix | 43 ++++++++++++++++++++++ .../nixvim/plugins/lsp/open-diagnostic-float.lua | 3 ++ 2 files changed, 46 insertions(+) create mode 100644 modules/development/nixvim/plugins/lsp/default.nix create mode 100644 modules/development/nixvim/plugins/lsp/open-diagnostic-float.lua (limited to 'modules/development/nixvim/plugins/lsp') diff --git a/modules/development/nixvim/plugins/lsp/default.nix b/modules/development/nixvim/plugins/lsp/default.nix new file mode 100644 index 0000000..1d56b66 --- /dev/null +++ b/modules/development/nixvim/plugins/lsp/default.nix @@ -0,0 +1,43 @@ +# Language Server Protocol configuration +{ config, lib, ... }: +{ + config.programs.nixvim = lib.mkIf config.development.nixvim.enable { + plugins.lsp = { + enable = true; + inlayHints = true; + autoLoad = true; + + keymaps = { + lspBuf = { + "lh" = "hover"; + "lr" = "references"; + "ld" = "definition"; + "li" = "implementation"; + "lt" = "type_definition"; + "lD" = "declaration"; + "lR" = "rename"; + "la" = "code_action"; + "lf" = "format"; + "ls" = "signature_help"; + "lwa" = "add_workspace_folder"; + "lwr" = "remove_workspace_folder"; + "lwl" = "list_workspace_folders"; + }; + diagnostic = { + "le" = "open_float"; + "lq" = "setloclist"; + "[d" = "goto_prev"; + "]d" = "goto_next"; + }; + }; + }; + + autoCmd = [ + { + event = [ "CursorHold" ]; + pattern = "*"; + callback.__raw = builtins.readFile ./open-diagnostic-float.lua; + } + ]; + }; +} diff --git a/modules/development/nixvim/plugins/lsp/open-diagnostic-float.lua b/modules/development/nixvim/plugins/lsp/open-diagnostic-float.lua new file mode 100644 index 0000000..fbfb9b9 --- /dev/null +++ b/modules/development/nixvim/plugins/lsp/open-diagnostic-float.lua @@ -0,0 +1,3 @@ +function() + vim.diagnostic.open_float(nil, { focus = false }) +end -- cgit v1.2.3