How to set your default editor in Linux

H
  1. Edit the .bash_profile file in your home directory
    vi ~/.bash_profile
  2. Add the following lines to your .bash_profile file
    export VISUAL=vim
    export EDITOR="$VISUAL"

    Note: Replace vim with any other preferred editor such as nano

  3. Logout and login again for changes to take effect.
  4. If you want the changes to come into play immediately, execute the following command
    . ~/.bash_profile

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me