mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-18 18:01:17 +00:00
fastaction: move to vim.ui, remove mappings, enable register_ui_select by default
This commit is contained in:
parent
7e8a53bc03
commit
24b4902913
10 changed files with 35 additions and 74 deletions
|
|
@ -1,10 +0,0 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
imports = [
|
||||
./fastaction-nvim
|
||||
];
|
||||
options.vim.lsp.code-actions = {
|
||||
enable = mkEnableOption "code-actions. Setting this to `false` will disable all code action plugins.";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
|
||||
|
||||
cfg = config.vim.lsp.code-actions;
|
||||
self = import ./fastaction-nvim.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.code-actions.fastaction-nvim.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.fastaction-nvim.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.fastaction-nvim.enable) {
|
||||
vim = {
|
||||
startPlugins = ["fastaction-nvim"];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>c" = "Code Actions";
|
||||
};
|
||||
|
||||
maps = {
|
||||
normal = mkSetLuaBinding mappings.code_action "require('fastaction').code_action";
|
||||
visual = mkSetLuaBinding mappings.range_action "require('fastaction').range_code_action";
|
||||
};
|
||||
|
||||
pluginRC.fastaction-nvim = entryAnywhere ''
|
||||
-- Enable trouble diagnostics viewer
|
||||
require('fastaction').setup(${toLuaObject cfg.fastaction-nvim.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./fastaction-nvim.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp.code-actions.fastaction-nvim = {
|
||||
enable = mkEnableOption "code actions for Neovim via fastaction.nvim";
|
||||
setupOpts = mkPluginSetupOption "fastaction-nvim" {};
|
||||
|
||||
mappings = {
|
||||
code_action = mkMappingOption "Displays code action popup [Fastaction.nvim]" "<leader>cfa";
|
||||
range_action = mkMappingOption " Displays code actions for visual range [Fastaction.nvim]" "<leader>cra";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -16,8 +16,5 @@
|
|||
./lspkind
|
||||
./lsplines
|
||||
./nvim-docs-view
|
||||
|
||||
# Code Actions
|
||||
./code-actions
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue