How to Use Emacs

How to Use Emacs


Emacs For the Dummies

To run emacs, just type
   emacs filename
where filename is the file you want to edit.

The simplest commands:

Use the arrow keys to move the cursor

C-x C-f         open a new file
C-x C-s         save the current file
C-x C-c         exit the emacs (but save files first)
Here, the prefix C- refers to the CONTROL key. For example, C-x means to simultaneously press the CONTROL key and the "x" key.


Key Bindings (that I use)

In the following, the prefix C- refers to the CONTROL key, the prefix ESC- refers to the ESCAPE key. For example, C-n means to simultaneously press the CONTROL key and the key "n".

C-h b 			list key bindings

Text:
C-k             kill the current line
C-space set a region mark C-w kill-region (between cursor and mark) ESC-w memorize the contents of the region (without kill) C-y yank (i.e., insert text last killed or memorize) C-_ undo Search:
C-s isearch-forward
C-r isearch-backward

Files:
C-x C-f find-file
C-x C-r find-file-read-only
C-x C-s save-current-file

Windows:
C-x 1 delete-other-windows C-x 2 split-window-vertically
Misc:
C-x o move the cursor to the other window
C-x b switch to a different buffer
C-x C-c save-buffers-kill-emacs


Running Macaulay 2 (M2)

 
ssh <your_account>@galois.math.uic.edu
 
To be able to run M2 in emacs add the following line to .emacs (in your home directory):
 
(load "/usr/local/Macaulay2-0.9.2/lib/Macaulay2-0.9.2/emacs/M2-init.el")
 
To run M2 in emacs push F12.
To execute the current line or selection in the M2 window push F11.