diff --git a/modules/visuals/config.nix b/modules/visuals/config.nix index ff87b50..967555e 100644 --- a/modules/visuals/config.nix +++ b/modules/visuals/config.nix @@ -50,6 +50,8 @@ in { ) ]; + vim.maps.normal = mkIf (cfg.cellularAutomaton.enable) (mkBinding cfg.cellularAutomaton.mappings.makeItRain "CellularAutomaton make_it_rain" "Make it rain"); + vim.luaConfigRC.visuals = nvim.dag.entryAnywhere '' ${ if cfg.lspkind.enable @@ -134,8 +136,6 @@ in { end require("cellular-automaton").register_animation(config) - - vim.keymap.set("n", "fml", "CellularAutomaton make_it_rain") '' else "" } diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index 7fe03ad..679d388 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -36,10 +36,16 @@ with builtins; { default = false; }; - cellularAutomaton.enable = mkOption { - type = types.bool; - description = "Enable cellular automaton [cellular-automaton]"; - default = false; + cellularAutomaton = { + enable = mkOption { + type = types.bool; + description = "Enable cellular automaton [cellular-automaton]"; + default = false; + }; + + mappings = { + makeItRain = mkMappingOption "Make it rain [cellular-automaton]" "fml"; + }; }; fidget-nvim = {