treewide: begin restructuring the module tree

This commit is contained in:
raf 2024-04-07 17:16:08 +03:00
commit 7c730a78e5
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
254 changed files with 749 additions and 664 deletions

View file

@ -0,0 +1,26 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.motion.hop;
self = import ./hop.nix {inherit lib;};
mappingDefinitions = self.options.vim.utility.motion.hop.mappings;
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in {
config = mkIf cfg.enable {
vim.startPlugins = ["hop-nvim"];
vim.maps.normal = mkSetBinding mappings.hop "<cmd> HopPattern<CR>";
vim.luaConfigRC.hop-nvim = entryAnywhere ''
require('hop').setup()
'';
};
}

View file

@ -0,0 +1,6 @@
_: {
imports = [
./hop.nix
./config.nix
];
}

View file

@ -0,0 +1,12 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
in {
options.vim.utility.motion.hop = {
mappings = {
hop = mkMappingOption "Jump to occurences [hop.nvim]" "<leader>h";
};
enable = mkEnableOption "Hop.nvim plugin (easy motion)";
};
}