mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-07 10:51:36 +00:00
treewide: begin restructuring the module tree
This commit is contained in:
parent
e1835f6c46
commit
7c730a78e5
254 changed files with 749 additions and 664 deletions
15
modules/plugins/minimap/codewindow/codewindow.nix
Normal file
15
modules/plugins/minimap/codewindow/codewindow.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.minimap.codewindow = {
|
||||
enable = mkEnableOption "codewindow plugin for minimap view";
|
||||
|
||||
mappings = {
|
||||
open = mkMappingOption "Open minimap [codewindow]" "<leader>mo";
|
||||
close = mkMappingOption "Close minimap [codewindow]" "<leader>mc";
|
||||
toggle = mkMappingOption "Toggle minimap [codewindow]" "<leader>mm";
|
||||
toggleFocus = mkMappingOption "Toggle minimap focus [codewindow]" "<leader>mf";
|
||||
};
|
||||
};
|
||||
}
|
42
modules/plugins/minimap/codewindow/config.nix
Normal file
42
modules/plugins/minimap/codewindow/config.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
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;
|
||||
|
||||
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")
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>m" = "+Minimap";
|
||||
};
|
||||
|
||||
luaConfigRC.codewindow = entryAnywhere ''
|
||||
local codewindow = require('codewindow')
|
||||
codewindow.setup({
|
||||
exclude_filetypes = { 'NvimTree', 'orgagenda', 'Alpha'},
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/minimap/codewindow/default.nix
Normal file
6
modules/plugins/minimap/codewindow/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./codewindow.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue