Tuesday, 24 September 2019

ubuntu - Change default text editor for crontab to vim


I'm using ubuntu 9.10 and the default text editor is nano, which i hate. (doesn't everyone?)


Normally it's not a problem as i just vi or gedit everything but crontab -e is opening with nano. I tried changing it to vim using sudo update-alternatives --config editor and selecting option 3 ("/usr/bin/vim.basic"). This has changed it for sudo and non-sudo alike. But crontab -e still opens nano. Any ideas? max



Answer



The crontab -e command will check the environment variables $EDITOR and $VISUAL for an override of the default text editor, so...


export VISUAL=vim

or


export EDITOR=vim

should do the trick.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...