Edit: This was a misunderstanding on my part. I wanted the terminal to use vim keybindings and I mistakenly thought this was accomplished by setting the default editor. I am editing this post so that in the future it may help those with a similar lack of understanding. Thanks to everyone who helped me. This is my first time interacting with the Fedora community and it was very helpful. Thank you.
New Fedora user here. I’m having trouble setting my default editor to vim. I installed Vim using sudo dnf install vim-default-editor --allowerasing. As expected this uninstalled nano-default-editor. However, Vim is not the editor being used when I run a terminal. If I run echo $EDITOR the output is pointing to Vim:/usr/bin/vim. I’ve also tried setting environmental variables in ~/.bashrc and ~/.bash_profile. For example, export EDITOR=vim and export EDITOR=/usr/bin/vim. I’ve also tried the same thing in /etc/bashrc and /etc/profile. I’ve been at this for a while now so I figured I turn it over to the community to get some help. Thanks!
I had a similar issue, and since I wanted both editors to be avialable, but to use vim by default had to make a small change in /etc/profile.d
What I did was copy /etc/profile.d/nano-default-editor.sh to /etc/profile.d/vim-default-editor.sh and edited the new vim-default-editor.sh to change the EDITOR from /usr/bin/nano to /usr/bin/vim.
By default only vim-minimal is installed, so to get the /usr/bin/vim I also had to install vim-enhanced (or use the minimal provided /usr/bin/vi)
I wanted nano to remain so I did not install vim-default-editor in place of nano-default-editor.
I then renamed the original nano-default-editor.sh to nano-default-editor.save
The next time I rebooted and logged in it had reset $EDITOR to point to vim and I was all set.
vim-enhancedis installed. When I ran sudo dnf list installed nano* turns out that nano was still installed. So installing vim-default-editor only removed nano-default-editor. I removed nano and bash still doesn’t use Vim.
I tried this but it didn’t work for me. I removed all of my environment declarations, uninstalled nano, vim-enhanced, and vim-default-editor. Essentially creating a blank slate. Then I installed nano, nano-default-editor, and vim-enhanced. After that I followed these instructions. Again, echo $EDITOR returns /usr/bin/vim as expected but bash is still isn’t using Vim as the editor.
I’m running gnome-terminal. So I’m attempting to use Vim in this context but it continues to use Nano. Never used Nano so I’m assuming it is Nano because it sure isn’t Vim. My understanding is that Nano is the default editor in Fedora.
My apologies. I’m afraid I don’t understand the question. I’m trying to setup my terminal to use the vim text editor keybindings. Typically in the past on other distros, setting an env variable in ~/.bashrc has sufficed.