TLDR; Starting with Fedora 33 the default editor is nano. If you're expecting vi(m) then there's a simple package you can install to get back into good shape.
I recently made the switch over to Fedora 33 and was a bit shocked when I began setting up my machine. I had gone to run visudo
and the unexpected happened:
I feel like I had already stumbled across this change at some point in the past. But there it was right in front of my face. NANO! Where was my precious vim
?
How do we fix this injustice inconvenience?
All jokes aside, this wasn't a huge deal. But it was definitely something that was going to throw a wrench into my usual workflow. So I set off to figure out what the best way to get things back in working order was going to be. Luckily for anybody looking to make this change as well, it's already been wrapped up into a package and you just need to run a single command to get back into working order.
dnf install -y vim-default-editor
This was great because although you can likely just set some environment variables, there are also some other defaults and configurations that may not rely on the EDITOR
environment variable that you don't want to manually go hunting for.
One important thing to call out here though is after you install this package, make sure to reboot your machine (or maybe at least restart your shell ?). One problem that I ran into was that although I had installed this package and most things were functioning as expected, the EDITOR
variable wasn't immediately changed. So when I went to run things like kubectl edit <something>
, it still popped me into nano. This likely isn't the only tool that will do something like that, so hopefully this helps prevent some strife for someone else in the future.
Top comments (5)
Thanks for the post! Just for the record, I had to
dnf remove nano-default-editor
first, because installingvim-default-editor
gave me transaction resolution conflicts. Weirdly, beforehand I foundvisudo
did use vim .. but EDITOR wasnano
and e.g.less <file>
and pressingv
to edit the file dropped me intonano
. I also had to reboot to make the change take effect, logging out and in again wasn't enough.Run with
sudo dnf install --allowerasing vim-default-editor
to replace in-placeWell, this is garbage. I just ripped out
nano-default-editor
withdnf remove -y
, and look at everything it removed:Then, I installed
vim-default-editor
by itself, and afterward separately tried to installtoolbox-{experience,support}
, and it said it required--allowerasing
And look what that does:
So I guess you can't use
vim
by default and toolbox at the same time in F36? That's beyond ridiculous.dnf install -y vim-default-editor --allowerasing
Last metadata expiration check: 3:10:41 ago on Sun 17 Jul 2022 06:14:27 PM CEST.
Dependencies resolved.
Package Architecture Version Repository Size
Installing:
vim-default-editor noarch 2:9.0.049-1.fc36 updates 20 k
Removing dependent packages:
nano-default-editor noarch 6.0-2.fc36 @fedora 514
Transaction Summary
Install 1 Package
Remove 1 Package
Total download size: 20 k
Downloading Packages:
vim-default-editor-9.0.049-1.fc36.noarch.rpm 88 kB/s | 20 kB 00:00
Total 33 kB/s | 20 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : vim-default-editor-2:9.0.049-1.fc36.noarch 1/2
Erasing : nano-default-editor-6.0-2.fc36.noarch 2/2
Verifying : vim-default-editor-2:9.0.049-1.fc36.noarch 1/2
Verifying : nano-default-editor-6.0-2.fc36.noarch 2/2
Installed:
vim-default-editor-2:9.0.049-1.fc36.noarch
Removed:
nano-default-editor-6.0-2.fc36.noarch
Complete!
No, no reboot...neither logout
it's a profile subdir file, here it is:
cshell:
/etc/profile.d/vim-default-editor.csh
bash:
/etc/profile.d/vim-default-editor.sh
it's enough to su -
and... voila'