Set vim as default cronjob editor

Method 1

1vi /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

1vi /root/.bash_profile

Add

1export VISUAL=vi

Once added, .bash_profile will look like

[email protected] [~]# 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
[email protected] [~]#

Method 3 If you need it done one time only, run following commands on command prompt.

1VISUAL=vi; export VISUAL

Leave a Comment

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

Hire a server Expert to resolve the issue Now.

Hire a server Expert to resolve the issue Now.

Resolve this issue in just 5$ from https://serverexpert.io

 

You have Successfully Subscribed!

Open chat