Steps to set default text editor in Linux

kumkumsharma

Administrator
Staff member
You can set any default text editor in linux according to your choice. Like if you want you can set default text editor nano or vi.

You can follow below steps to set default text editor:
  • Login to server via SSH.
  • Now you have to open .bashrc file in any text editor.
  • Now you have to add below lines in that file
  • Open the .bashrc file in your preferred text editor.
  • Add the following lines to the .bashrc file. Replace both occurrences of program with the editor you want to set as the default editor:
Code:
export EDITOR='program'
export VISUAL='program'
  • To set vi as the default text editor, replace program with vi.
  • To set nano as the default text editor, replace program with nano.
  • Save the changes to the .bashrc file and exit the text editor.
  • To make the new default text editor settings take effect, log out of your account and then log back in. Alternatively, you can just type the following command:
Code:
Copysource .bashrc
 
Top