Set vim as default cronjob editor
Method 1
1 |
vi /etc/bashrc |
Find
1 2 |
export EDITOR="pico" export VISUAL="pico" |
Replace with
1 2 |
export EDITOR="vi" export VISUAL="vi" |
Method 2
edit .bash_profile
1 |
vi /root/.bash_profile |
Add
1 |
export VISUAL=vi |
Once added, .bash_profile will look like
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
root@server54 [~]# cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export VISUAL=vi export PATH unset USERNAME uptime root@server54 [~]# |
Method 3
If you need it done one time only, run following commands on command prompt.
1 |
VISUAL=vi; export VISUAL |