Tricks:Professor Ehrlich's Guide to Emacs
Son of Emacs: A second Emacs
by Professor Heyward Ehrlich, English Department, Rutgers/Newark
1. Learning more:
Those who want to learn more about Emacs can consult the handouts and
on-line material already available. When logged in to Rutgers
andromeda or pegasus, for example, follow the sequence "rush" and then
"file" and then "teachemacs" to run an interactive tutorial. Since
Emacs is a standard Unix editor, printed and online materials are
widely available.
2. Misinformation:
But before we go further, here's some misinformation in some sources:
Misinformation Correction
^H deletes to left ^H may actually launch Help
^C to quit N.G, use f ^C does nothing
^Z quits to shell,
^C^C to quit ^Z quits to shell, ^C^C does nil
--^X^C exits the edit
^U to undo ^XU undoes
3. Addenda to original Emacs.Doc (2/15/95)
^V view next screen
ESC-V view previous screen
^X-O move cursor to other of 2 screens
^X-1 make current screen full screen
^U repeat times
ESC-C capitalize current character
ESC-U uppercase whole word
ESC-L lowercase whole word
CTRL-T transpose character to left
ESC-T transpose word to left
4. Troubles
You may be told in documentation that the Backspace key
deletes the character to the left, and that the DEL key deletes the
character to the right. Since Emacs can remap the keyboard, you may
get a different result using a wired school lab machine and a home
dial-in connection. The results can be confusing:
If Backspace sends a CTRL-H code it will activate help mode.
If this happens, use CTRL-G to cancel help. Try CTRL-Backspace.
Or do CTRL-B, CTRL-D.
If DEL sends a "." code, press NumLock to switch from
numberpad to cursorpad functions. Watch to see if you are deleting
the character to the right or to the left!
On some DOS machines, the search command (^S), is read by DOS
to suspend screen scrolling, bringing everything to a dead halt. If
this happend, use the DOS command to resume scrolling (^Q), and avoid
using CTRL-S.
If you type ESC ESC by mistake and get a prompt, type n.
For key-command information type
CTRL-H K (e.g. ^H K ^F)
To get rid of the (other) screen, type
^X-1
Deleting: (see caution above: your keyboard may work differently)
DEL delete current character
Backspace delete previous character
ESC D delete next word
ESC Backspace delete previous word
ESC Del delete current word
The kill buffer:
Multiple kills (cuts) are kept in the kill buffer. A
continuous series of kills (cuts) is regarded as one. The typical
kill command is CTRL-K, which cuts to the end of the line. If
deleting the entire line, repeat the command a second time to delete
the invisible endline character.
You can retrieve the last text chunk from the kill buffer and
paste it anywhere -- even repeating the paste. The retrieve command is
CTRL-Y (yank back). Once you do this, you can continue to retrieve or
paste previous kills with the ESC-Y command (which can be repeated.
Switching files:
You can open a second file with this command:
CTRL-X, CTRL-F
You can list the file buffers open with this command:
CTRL-X, CTRL-B
For prompts to save all the open file buffers, type
CTRL-X, S
Extended commands:
CTRL-X commands:
C-x C-f Find file.
C-x C-s Save file.
C-x C-b List buffers.
C-x C-c Quit Emacs.
C-x u Undo.
Function calls: ESC X
If you wish to call "replace-string". Just type "repl s"
and Emacs will complete the name. Press . Then type 1) the string
to be replaced and then 2) and the string to replace it with .
Modes: text mode
auto-fill mode
ESC-x auto-fill-mode . (usually 70)
CTRL-U nn CTRL-x f (margin at nn)
Search:
CTRL-S string (forward incremental search)
CTRL-S (next instance)L
CTRL-R string (reverse search)
ESC or CTRL-F (end search mode)
Whay you type during the search (other then ESC or CTRl-G),
edits the target string as you go suring the search. Thus deleting
the last character "backs up" to the previous hit.
MORE HELP
---------
CTRL-H help mode
then ? tyoes of help
^G cancel help mode
c describe command enacted (e.g. ^S)
k more command description
f describe named function (e.g. search)
a apropos commands using keyword (, e.g "file")
Exit:
to shell CTRL-Z
permanently CTL-X, CTRL-C
MORE....
There are some more advanced things in Emacs still, but this is surely
enough for the moment.
Heyward Ehrlich
ehrlich@andromeda.rutgers.edu