mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-12-02 17:37:17 +00:00
35 lines
1 KiB
Nix
35 lines
1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
|
|
|
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"];
|
|
|
|
maps = {
|
|
normal = mkMerge [
|
|
(mkSetLuaBinding mappings.code_action "require('fastaction').code_action")
|
|
(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})
|
|
'';
|
|
};
|
|
};
|
|
}
|