-
How to change the default text editor in Linux
Posted on December 24th, 2008 No commentsAll Linux distributions have a text editor set by default. For example, in Ubuntu,
nanois set as the default text editor for use in console mode. In Linux, you can change default editor to one of your choice by changing the$EDITORenvironment variable.For example, to change the default editor from
nanotovim, I need to open the.bashrcfile and append the following line.#FILE: .bashrc ... export EDITOR="vim"
Various command line applications such as
crontab,svnandvisudomake use of the$EDITORvariable to choose the default text editor.How to change default text editor in Ubuntu
In Debian based Linux distributions (Ubuntu), you can change the default text editor using a script called
update-alternatives. This is how it is done …Open a terminal and type the following command :
$ sudo update-alternatives --config editor
An alternative to using
sudois to login as root, in which case, you can run the above command without usingsudo. Next you will be prompted for your password. After you enter the correct password, you are provided a list of console text editors found on your system. Pick your choice to change the default text editor.[sudo] password for linuxandfriends: ***** There are 3 alternatives which provide `editor'. Selection Alternative ----------------------------------------------- 1 /usr/bin/vim.tiny 2 /bin/ed *+ 3 /bin/nano Press enter to keep the default[*], or type selection number: 1Related Posts
- Ubuntu Linux – How to change default display manager
- Scribes – A sleek, lightweight text editor for Linux
- Change screen resolution in Ubuntu Linux
- Text editors for distraction free writing
- How To Install LAMP Server in Ubuntu Linux
