From 83583e9b6477ec92bceba56fa3ef7f4f325c33e9 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Mon, 6 May 2024 16:05:43 -0400 Subject: [PATCH] plugins/lsp: filter out null mappings --- modules/plugins/lsp/config.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/plugins/lsp/config.nix b/modules/plugins/lsp/config.nix index ba93b28..d91a4fb 100644 --- a/modules/plugins/lsp/config.nix +++ b/modules/plugins/lsp/config.nix @@ -16,7 +16,10 @@ mappingDefinitions = self.options.vim.lsp.mappings; mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; - mkBinding = binding: action: "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', 'lua ${action}', {noremap=true, silent=true, desc='${binding.description}'})"; + mkBinding = binding: action: + if binding.value != null + then "vim.api.nvim_buf_set_keymap(bufnr, 'n', '${binding.value}', 'lua ${action}', {noremap=true, silent=true, desc='${binding.description}'})" + else ""; in { config = mkIf cfg.enable { vim = {