From 1e0916836a231dc630668fcc29f94688f01b978c Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 11 Dec 2025 23:58:21 +0100 Subject: [PATCH] defaultEditor also sets {env}`VISUAL` same as https://github.com/nix-community/home-manager/pull/8322 --- wrappers/hm.nix | 5 ++++- wrappers/nixos.nix | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wrappers/hm.nix b/wrappers/hm.nix index 9e4a4ab7..4a6a9b37 100644 --- a/wrappers/hm.nix +++ b/wrappers/hm.nix @@ -38,7 +38,10 @@ in cfg.build.package ]; - home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "nvim"; }; + home.sessionVariables = mkIf cfg.defaultEditor { + EDITOR = "nvim"; + VISUAL = "nvim"; + }; programs = mkIf cfg.vimdiffAlias { bash.shellAliases.vimdiff = "nvim -d"; diff --git a/wrappers/nixos.nix b/wrappers/nixos.nix index 1fc63c6f..21c04510 100644 --- a/wrappers/nixos.nix +++ b/wrappers/nixos.nix @@ -42,6 +42,7 @@ in environment.variables = { VIM = mkIf (!cfg.wrapRc) "/etc/nvim"; EDITOR = mkIf cfg.defaultEditor (lib.mkOverride 900 "nvim"); + VISUAL = mkIf cfg.defaultEditor (lib.mkOverride 900 "nvim"); }; programs.neovim.defaultEditor = cfg.defaultEditor;