diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index a3b87ea24..142d56d7c 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -390,7 +390,10 @@ in { home.packages = [ cfg.finalPackage ]; - home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "nvim"; }; + home.sessionVariables = mkIf cfg.defaultEditor { + EDITOR = getBin + (pkgs.writeShellScript "editor" "exec ${getBin cfg.package}/bin/nvim"); + }; xdg.configFile = let hasLuaConfig = hasAttr "lua" config.programs.neovim.generatedConfigs; diff --git a/modules/programs/vim.nix b/modules/programs/vim.nix index 2f13caeee..138e24151 100644 --- a/modules/programs/vim.nix +++ b/modules/programs/vim.nix @@ -174,7 +174,10 @@ in { home.packages = [ cfg.package ]; - home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "vim"; }; + home.sessionVariables = mkIf cfg.defaultEditor { + EDITOR = getBin + (pkgs.writeShellScript "editor" "exec ${getBin cfg.package}/bin/vim"); + }; programs.vim = { package = vim;