Changing the default editor
From Gentoo Linux Wiki
| Terminals / Shells • Network • X Window System • Portage • System • Filesystems • Kernel • Other |
The default editor in Gentoo is used by various console applications which initiate editing of config files (crontab) or require input that it too complicated to enter on the command line (svn). Initially, the default editor is set to Nano.
[edit] Global setting
To change this setting system wide, change the EDITOR variable in /etc/rc.conf to the editor you wish to use. For example:
| File: /etc/rc.conf |
# Set EDITOR to your preferred editor. #EDITOR="/usr/bin/nano" #EDITOR="/usr/bin/emacs" #EDITOR="/usr/bin/vim" EDITOR="/usr/bin/mcedit" |
[edit] Per-user setting
Use
export EDITOR=/usr/bin/emacs
to change the editor only for the current session, or
echo -e "export EDITOR=/usr/bin/emacs" >> ~/.profile
to change it permanently.
