The Ohio State University
Fisher College of Business logo

Knowledge Base

Unix Research - Emacs

What is GNU Emacs?
GNU Emacs is a customizable and extensible text editor. GNU Emacs is a very powerful environment which can be used to edit the simplest of text files or used for more productive source code development. Both a text-based interface and graphical user interface are available.

How do I invoke GNU Emacs?
When you login to any of the Unix research servers, simply type emacs [filename] and press Enter.

How do I invoke the GNU Emacs Graphical User Interface (GUI)?
First, you must have a X11 server running and SSH X11 tunneling properly configured. Please see the X Windows Knowledge Base.

Second, you simply invoke GNU Emacs as you normally would: emacs [filename].

I have an X11 Server running and SSH X11 tunneling configured, but I do not want to use the GNU Emacs GUI.
If the GNU Emacs GUI is running, but you'd rather use the text-based interface, simply use the -nw command line argument to Emacs like so: emacs -nw [filename].

I need help with GNU Emacs! How do I open a file or save my work?
GNU Emacs uses a series of keyboard shortcuts designed to minimize moving your fingers from the home row on your keyboard. Most keyboard shortcuts use the Control key plus another key. For example, C-x means to hold the Control key and the x key at the same time. Sometimes an Emacs shortcut is a series of two or more Control key sequences. For example C-x C-f means to hold the Control key plus x, then the Control key plus f in quick succession.

The following is a short list of the most common keyboard shortcuts:

  • Open a file: C-x C-f
  • Write changes to a file: C-x C-s
  • Quit GNU Emacs: C-x C-c

A more complete GNU Emacs reference is also available online.

How can I turn on syntax highlighting for SAS and R?
Add the following lines to the .emacs file in your home directory.;; Set load-path
(setq load-path (cons "/usr/local/share/emacs/site-lisp" load-path))
;; Load Emacs Speaks Statistics
(require 'ess-site)

The restart emacs.