In Emacs, how do I switch modes?
To change a buffer's mode while using Emacs, enter:
M-x indicates pressing the Meta key (if you
have one) and
x . If you don't have a
Meta key, press and release the
Esc key, and
x . Replace
with the name of the mode to which you want to switch. For more
information about keystrokes in Emacs, see In Emacs, how are keystrokes denoted?
What follows is a list of some of the major modes and their functions. The phrases in the "Mode-name" column can be used with the command above to switch modes.
|lisp-mode||Lisp code (other than Emacs Lisp)|
Note that these are all major modes. A file in a
buffer can only be in one major mode at a time. There are also
numerous minor modes, such as overwrite-mode (for
overwriting instead of inserting text), and auto-fill-mode (for
automatically wrapping text as you write it). A buffer may have
multiple minor modes. To get a list of the all
the available modes, both major and minor, on your system's version of
Emacs, look up "mode" using Emacs' apropos command. Do this by
C-h a and entering the word
If you wish to set up Emacs to automatically enter a certain mode when opening a certain file type, see In Emacs, how can I make the program start in a given mode?
At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?
Last modified on February 16, 2011.