From 810aae53b2881e034b5d17b3ac1cf6132f30a578 Mon Sep 17 00:00:00 2001 From: n3oney Date: Sat, 15 Apr 2023 15:35:34 +0200 Subject: [PATCH] feat: add cellularAutomaton keybindings --- modules/visuals/config.nix | 4 ++-- modules/visuals/visuals.nix | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) 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 = {