{ config, lib, ... }: let inherit (lib) mkIf mapAttrsToList; cfg = config.ooknet.editor.nvim; console = config.ooknet.console; in { config = mkIf (cfg.enable || console.editor == "nvim") { programs.nixvim = { globals = { mapleader = " "; maplocalleader = " "; }; keymaps = let normal = mapAttrsToList (key: action: { mode = "n"; inherit action key; }) { "" = ""; "esc" = ":noh"; "Y" = "$y"; }; visual = mapAttrsToList (key: action: { mode = "v"; inherit action key; }) { # better indenting ">" = ">gv"; "<" = "" = ">gv"; "" = "