nvf/modules/plugins/minimap/codewindow/config.nix

43 lines
1.2 KiB
Nix
Raw Permalink Normal View History

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
cfg = config.vim.minimap.codewindow;
2023-05-02 21:06:35 +00:00
self = import ./codewindow.nix {inherit lib;};
mappingDefinitions = self.options.vim.minimap.codewindow.mappings;
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"codewindow-nvim"
];
maps.normal = mkMerge [
(mkSetLuaBinding mappings.open "require('codewindow').open_minimap")
(mkSetLuaBinding mappings.close "require('codewindow').close_minimap")
(mkSetLuaBinding mappings.toggle "require('codewindow').toggle_minimap")
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
];
2023-05-02 21:06:35 +00:00
binds.whichKey.register = pushDownDefault {
"<leader>m" = "+Minimap";
};
2024-02-25 16:39:05 +00:00
pluginRC.codewindow = entryAnywhere ''
local codewindow = require('codewindow')
codewindow.setup({
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
})
'';
};
};
}