Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

change default editor linux

### METHOD 1 - Via Command line ###
# If you have never set it before
echo "export EDITOR='new_program'" >> ~/.bashrc
echo "export VISUAL='new_program'" >> ~/.bashrc
source ~/.bashrc

### METHOD 2 - Via Command line ###
# If you are changing an existing setting
sed -i 's/export EDITOR='old_program'/export EDITOR='new_program'/' ~/.bashrc
sed -i 's/export VISUAL='old_program'/export VISUAL='new_program'/' ~/.bashrc
source ~/.bashrc

### METHOD 3 - Via Text Editor ###
# You can also change the setting by opening ~/.bashrc in
# your favourite text editor then add/update the lines
export EDITOR='new_program'
export VISUAL='new_program'
# Exit & Save File then run below command
source ~/.bashrc
Source by www.a2hosting.com #
 
PREVIOUS NEXT
Tagged: #change #default #editor #linux
ADD COMMENT
Topic
Name
7+9 =