neovim-flake/modules/minimap/codewindow/config.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

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