Modify ubuntu default editor to vim

  

Modify ubuntu default editor to vim Normally, the default editor under ubuntu terminal is nano, we directly edit a file, the default will open nano. For example, when we enter “crontab -e“, the nano editor will be opened by default. For those who are familiar with VIM, we want the default editor to use vim, then we need to modify the default editor of ubuntu. There are three ways to modify the default editor of ubuntu: 1. Directly input in the terminal: echo export EDITOR=/usr/bin/vim >> ~/.bashrc Second, use the system management tool update-alternatives to modify the input in the terminal: Br>

update-alternatives --config editor Then select vim.basic this. Third, if there are only two editors in the system, nano and vim, this time we will completely remove nano, then the system will choose by default. Vim is the default editor. Enter the command to delete the nano editor in the terminal: sudo apt-get remove nano After the modification is complete, we type: crontab -e Take a look at the vim editor that you like.

Copyright © Windows knowledge All Rights Reserved