{ lib, config, ... }: let cfg = config.presets.undotree; in { options.presets.undotree = { enable = lib.mkEnableOption "Undotree"; }; config = lib.mkIf cfg.enable { opts = { undodir.__raw = # lua "os.getenv('HOME') .. '/.config/nvim/undodir'"; undofile = true; }; keymaps = [ { key = "u"; mode = "n"; action = ":UndotreeToggle"; } ]; plugins = { undotree.enable = true; which-key.settings.spec = [ { __unkeyed-1 = "u"; desc = "Undotree"; icon = "󰕌"; } ]; }; }; }