feat: add nvim-code-action-menu keybindings

This commit is contained in:
n3oney 2023-05-02 23:22:35 +02:00
parent 25c9bb0962
commit 46c602f74d
No known key found for this signature in database
GPG key ID: C786693DE727850E
2 changed files with 12 additions and 10 deletions

View file

@ -6,12 +6,15 @@
with lib;
with builtins; let
cfg = config.vim.lsp;
self = import ./nvim-code-action-menu.nix {inherit lib;};
mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings;
mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions;
in {
config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) {
vim.startPlugins = ["nvim-code-action-menu"];
vim.maps.normal = {
"<silent><leader>ca" = {action = ":CodeActionMenu<CR>";};
};
vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
};
}

View file

@ -1,13 +1,12 @@
{
config,
lib,
...
}:
with lib;
with builtins; {
{lib, ...}:
with lib; {
options.vim.lsp = {
nvimCodeActionMenu = {
enable = mkEnableOption "Enable nvim code action menu";
mappings = {
open = mkMappingOption "Open code action menu [nvim-code-action-menu]" "<leader>ca";
};
};
};
}