My favourite editor is vim in Linux. I am very comfortable with it. But when I need to do some come some configuration(e.g. crontab -e), operating system opens it with default editor which is generally nano. This is annoying to me. Therefore, I generally change default editor with the following very simple step to vim:
Result print:
# sudo update-alternatives --config editor
Following table has printed.
There are 3 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/nano 40 manual mode
2 /usr/bin/vim.basic 30 manual mode
3 /usr/bin/vim.tiny 10 manual mode
Press enter to keep the current choice[*], or type selection number:
Write <2> and hit the enter.2>Result print:
update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in manual mode.
Now, default editor in the system is vim. To see the effect, run command crontab -e. It will be opened by vim.
Comments
Post a Comment