mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-21 15:49:48 +01:00
feat: add nvim-code-action-menu keybindings
This commit is contained in:
parent
25c9bb0962
commit
46c602f74d
2 changed files with 12 additions and 10 deletions
|
@ -6,12 +6,15 @@
|
||||||
with lib;
|
with lib;
|
||||||
with builtins; let
|
with builtins; let
|
||||||
cfg = config.vim.lsp;
|
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 {
|
in {
|
||||||
config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) {
|
config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) {
|
||||||
vim.startPlugins = ["nvim-code-action-menu"];
|
vim.startPlugins = ["nvim-code-action-menu"];
|
||||||
|
|
||||||
vim.maps.normal = {
|
vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
|
||||||
"<silent><leader>ca" = {action = ":CodeActionMenu<CR>";};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
{
|
{lib, ...}:
|
||||||
config,
|
with lib; {
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib;
|
|
||||||
with builtins; {
|
|
||||||
options.vim.lsp = {
|
options.vim.lsp = {
|
||||||
nvimCodeActionMenu = {
|
nvimCodeActionMenu = {
|
||||||
enable = mkEnableOption "Enable nvim code action menu";
|
enable = mkEnableOption "Enable nvim code action menu";
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
open = mkMappingOption "Open code action menu [nvim-code-action-menu]" "<leader>ca";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue