In Unix, how do I set my default (preferred) editor?
To set your default (preferred) editor on your Unix account, you must define the VISUAL and EDITOR environment variables. When you have done this, most Unix programs that use text editors (e.g., trn, tin, and
nn) will use the editor you have set.
The way to set these environment variables depends upon which Unix shell you use.
If you use
tcsh, at the shell prompt, enter:
setenv VISUAL editor setenv EDITOR editor
editor with the editor you want to use (e.g., Emacs, Pico, or vi).
If you use
bash, at the shell prompt, enter:
VISUAL=editor; export VISUAL EDITOR=editor; export EDITOR
editor with the editor you want to use (e.g., Emacs, Pico, or vi). You may want to include the full path to the editor (e.g.,
/bin/vi), rather than simply the name.
By following the commands above, you will set the default editor for the current computing session only. To make these changes permanent, you will need to place the appropriate commands described above in your
.cshrc files (for
tcsh users) or your
.profile file (if you use
At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?
This is document acnc in the Knowledge Base.
Last modified on 2016-12-06 11:13:50.
- Fill out this form to submit your issue to the UITS Support Center.
- Please note that you must be affiliated with Indiana University to receive support.
- All fields are required.