Saturday, May 18, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 559  / 1 Year ago, fri, april 7, 2023, 7:31:13

I found another way to set Vim as the default text editor in Ubuntu but I would like to know why this tutorial is not working for me:


https://www.a2hosting.com/kb/developer-corner/linux/setting-the-default-text-editor-in-linux


Here's what I did:


I edited ~/.bashrc by adding these 2 lines:


export EDITOR='vi'
export VISUAL='vi'

Then I typed the command:


source .bashrc

I also tried to log out of my account and then log back in but it's still not working.


When I try to open the /etc/sudoers file it opens with Nano text editor instead of Vim.


More From » vim

 Answers
5

The following command changes the system's default editor:


sudo update-alternatives --config editor


You will get prompted with the available editors, select vim from the list.


[#46] Sunday, April 9, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
herriail

Total Points: 11
Total Questions: 122
Total Answers: 118

Location: Peru
Member since Tue, Mar 16, 2021
3 Years ago
herriail questions
Tue, May 18, 21, 02:11, 3 Years ago
Sun, Dec 12, 21, 06:06, 2 Years ago
Wed, May 24, 23, 01:42, 1 Year ago
Sun, Jan 29, 23, 00:48, 1 Year ago
Fri, Jan 21, 22, 01:10, 2 Years ago
;