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