2023-02-03 22:19:51 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 01:50:27 +01:00
|
|
|
}: let
|
2024-03-12 01:46:46 +01:00
|
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
|
|
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
|
2023-11-07 01:50:27 +01:00
|
|
|
|
2023-02-03 22:19:51 +01:00
|
|
|
cfg = config.vim.minimap.codewindow;
|
2023-05-02 23:06:35 +02:00
|
|
|
|
|
|
|
self = import ./codewindow.nix {inherit lib;};
|
|
|
|
|
|
|
|
mappingDefinitions = self.options.vim.minimap.codewindow.mappings;
|
|
|
|
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
2023-02-03 22:19:51 +01:00
|
|
|
in {
|
|
|
|
config = mkIf cfg.enable {
|
2024-03-12 01:46:46 +01:00
|
|
|
vim = {
|
|
|
|
startPlugins = [
|
|
|
|
"codewindow-nvim"
|
|
|
|
];
|
2023-02-03 22:19:51 +01:00
|
|
|
|
2024-03-12 01:46:46 +01:00
|
|
|
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 23:06:35 +02:00
|
|
|
|
2024-03-12 01:46:46 +01:00
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
|
|
"<leader>m" = "+Minimap";
|
|
|
|
};
|
2024-02-25 17:39:05 +01:00
|
|
|
|
2024-07-15 12:40:05 +02:00
|
|
|
pluginRC.codewindow = entryAnywhere ''
|
2024-03-12 01:46:46 +01:00
|
|
|
local codewindow = require('codewindow')
|
|
|
|
codewindow.setup({
|
|
|
|
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
};
|
2023-02-03 22:19:51 +01:00
|
|
|
};
|
|
|
|
}
|