Set vim as default cronjob editor

Method 1

vi /etc/bashrc

Find

export EDITOR="pico"
export VISUAL="pico"

Replace with

export EDITOR="vi"
export VISUAL="vi"

Method 2

edit .bash_profile

vi /root/.bash_profile

Add

export VISUAL=vi

Once added, .bash_profile will look like

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.

VISUAL=vi; export VISUAL

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *