nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.2k stars 1.85k forks source link

bug: `neovim.defaultEditor` has no effect #4559

Open MangoIV opened 1 year ago

MangoIV commented 1 year ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

I have neovim.defaultEditor = true;, however, $EDITOR is set to nano. This happens on multiple shells but currently it happens on fish

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.55, NixOS, 23.11 (Tapir), 23.11.20231006.87828a0`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix Super) 2.19.0pre20230922_cae2c83`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
nathaniel-brough commented 1 year ago

This seems to be the case for the helix editor as well i.e. helix.defaultEditor = true;. Note that I'm using bash.

teto commented 1 year ago

is this still the case after a reboot ? this changes the value of sessionVariables so you need to relogin

nathaniel-brough commented 1 year ago

It is still the case after a reboot for helix. Haven't tried nvim.

hakan-demirli commented 10 months ago

I have the same problem but slightly different. EDITOR is set to helix not hx and since the package/binary name is hx it causes problems. Manually setting environment.variables.EDITOR to hx is also not working.

I also tried initExtra and sessionVariables options which only work for the apps directly launched from terminal. Anything launched from a script still uses the old EDITOR value.

programs.bash = {
    enable = true;   
    sessionVariables = {
      EDITOR = "hx";
    };
    initExtra = ''
      EDITOR="hx"
    '';
  };

I am on NIXOS and home manager is not installed as a nixos module.

hakan-demirli commented 9 months ago

OK. I have been using the same hyprland.conf since I was on Arch. I set the EDITOR env variable there and forgot about it. Sorry for the noise.

stale[bot] commented 6 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

teto commented 6 months ago

maybe you override EDITOR afterwards ? it's difficult to tell through the internet, most likely you'll have to debug this yourself sry

stale[bot] commented 2 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.