How to change your standard editor

Everyone who is using linux knows that if you type editor in a bash shell an editor opens. But where can you change that editor?

Change the editor temporarily

Just execute the following on your shell:

export EDITOR=joe

Change the editor forever

Edit ~/.bash_profile and add the following:

export EDITOR=joe

One Response to “How to change your standard editor”

  1. abresas says:

    I get a command not found when I type editor on my PC :(

    abresas@kepler ~ $ editor
    bash: editor: command not found

    I use Gentoo Linux. I guess this is also the same thing with the variable EDITOR defined in /etc/rc.conf:

    # Set EDITOR to your preferred editor.
    # You may use something other than what is listed here.

    #EDITOR=”/bin/nano”
    EDITOR=”/usr/bin/vim”
    #EDITOR=”/usr/bin/emacs”

Leave a Reply