2023-02-03 21:19:51 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
2024-02-25 16:39:05 +00:00
|
|
|
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim defaultAttributes;
|
2023-11-07 00:50:27 +00:00
|
|
|
|
2023-02-03 21:19:51 +00:00
|
|
|
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;
|
2023-02-03 21:19:51 +00:00
|
|
|
in {
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
vim.startPlugins = [
|
|
|
|
"codewindow-nvim"
|
|
|
|
];
|
|
|
|
|
2023-05-02 21:06:35 +00:00
|
|
|
vim.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")
|
|
|
|
];
|
|
|
|
|
2024-02-25 16:39:05 +00:00
|
|
|
vim.binds.whichKey.register = defaultAttributes {
|
|
|
|
"<leader>m" = "+Minimap";
|
|
|
|
};
|
|
|
|
|
2023-02-03 21:19:51 +00:00
|
|
|
vim.luaConfigRC.codewindow = nvim.dag.entryAnywhere ''
|
|
|
|
local codewindow = require('codewindow')
|
|
|
|
codewindow.setup({
|
2023-07-26 07:27:57 +00:00
|
|
|
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
|
2023-05-02 21:06:35 +00:00
|
|
|
})
|
2023-02-03 21:19:51 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|