Lin Hong's TECH Blog! 刀不磨要生锈,人不学习要落后 - Thinking ahead

Ubuntu Change default editor Tips

2019-12-01

Ubuntu Change default editor Tips

1. Modify .bashrc

$ echo export EDITOR=/usr/bin/vim >> ~/.bashrc 

2. Modify OS config editor

$ update-alternatives --config editor 
-> 3 (vim.basic)
root@inst-hk01:~# update-alternatives --config editor 
There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
* 3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    10        manual mode

Press <enter> to keep the current choice[*], or type selection number: 3
root@inst-hk01:~# 

3.remove other editors

$ sudo apt-get remove nano 

test

$crontab -e

Similar Posts

Comments