dR3b
December 1, 2025, 12:40pm
1
Hi, I wanted to change my default edit to neovim:
{
config,
pkgs,
...
}:
{
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
viAlias = true;
};
}
After a nixos-rebuild, Neovim is installed but Nano is still the default editor. What am I doing wrong?
[root@nix1-1:/etc/nixos]# echo $EDITOR
nano
[root@nix1-1:/etc/nixos]# vim
bash: vim: command not found
I tested this with a new virtual machine and with bash too.
Thanks!
NobbZ
December 1, 2025, 12:49pm
2
Assuming you imported the moule correctly, I would expect nvim being in PATH, while vim and vi would be aliases, that will only be available in a fresh shell.
Also EDITOR is a known problem, and depending on details of your shell configuration, this might or might not bubble through from the system configuration
tejing
December 1, 2025, 12:49pm
3
Environment variables don’t update until you relog. The first thing to do is see if it works as expected after logging out and back in.
2 Likes
dR3b
December 1, 2025, 1:00pm
4
NobbZ:
Assuming you imported the moule correctly, I would expect nvim being in PATH, while vim and vi would be aliases, that will only be available in a fresh shell.
Yes this is what i expected. But its not.
I did this.
NobbZ
December 1, 2025, 1:02pm
5
Do you mind sharing the complete configuration?
dR3b
December 1, 2025, 1:18pm
6
OK this is strange. I rebooted the entire host and now it works…