General things

The detailed manual of Emacs is the Emacs-Info. It can be started by the commands C-h i (<Control> h and then pressing i). This document is really useful for any starting Emacs user!

For modern versions of emacs, most important functions are provided by menus to the user. If, however, one learns the keybindings provided below, one can become a lot faster and more efficient in using Emacs.

For those that are working with Emacs for the first time there is a step by step tutorial to emacs available. After one starts the editor with the command e or esh (more info on this see Useful commands), one can start the introduction with C-h t (<Control> h and then pressing t). This tutorial can of course also be loaded through the menu: press the menu button Help, and then Tutorial.

The most common keycombinations can summarised on a single A4-page can be printed by executing: prt /u/sfs/emacs/doc/refcard-A4-3col.ps.gz.

About the notation: because key combinations are used all the time in emacs, the following abbreviations are used:

C-x stands for <Control> x, <CTRL> x.
M-x stands for <Meta> x, <ALT> x. On primitive Terminals, instead of <Meta> one has to use the ESC (Escape) key.
<RET> stands for the "Enter"-key. This is used to signal to Emacs to execute the current command or at least go to the next step.

In Emacs, various modes are being used when editing files. This means that, depending on the application/task (Mail, LaTeX, ESS (seeR and S in Emacs), ...) the current window (which is called Buffer in Emacs terminology) is in a certain mode which opens Emacs up to some extra keybindings. These provide easy access to some useful command for your current task.

Tip

With C-h m, one gets help information about every special mode one is in. It also provides help information about all keybindings.

Under X11 (see X11), one can also use the mouse. This is used to position your current working position in the file but, it can also be used for copying and pastin into files. If one wants to delete or copy a region, that is not bigger than your current window, one can do the following:
  1. Move to the beginning of the region with your marker and set a mark with C-<SPACE>
  2. Position the cursor at the end of the region. Damit ist die Region bestimmt (kontrollieren mittels zweimaligem C-x C-x, welches "point" und "mark" vertauscht). With C-w one cuts away the current region (delete and save for a paste). With M-w one copies the region without deleting it.
  3. If one wants to paste the current copied or cut region to somewhere else, one has to position the cursor at the desired position for the new text and press the key combination C-y (= paste).

General things

Das detaillierte Info-Manual ist das Emacs-Info. Es kann nach starten des Emacs mit C-h i (<Control> h und dann i) gestartet werden. Das Dokument ist wirklich sehr nützlich!

Beim heutigen Emacs werden die meisten wichtigen Funktionen via Menüs zur Verfügung gestellt. Das Lernen vieler der im folgenden erwähnten Tastenkombinationen ermöglicht jedoch oft ein wesentlich effizienteres Arbeiten.

Für all jene, die zum ersten Mal mit dem Emacs arbeiten, gibt es auch eine on-line Einführung in den Emacs das sogenannte Tutorial. Nachdem man mit dem Befehl e oder esh (mehr dazu unter Nützliche Befehle) den Editor gestartet hat, kann mit C-h t (<Control> h und dann t) die Einführung geladen werden. Das Tutorial kann natürlich auch via Menüs geladen werden: Menü Help, dann Tutorial. Von da an sollte alles selbsterklärend sein.

Die gängigsten Tastenkombinationen sind auf einer A4-Seite zusammengestellt die man ausdrucken kann: prt /u/sfs/emacs/doc/refcard-A4-3col.ps.gz.

Zur Notation: Weil das Verwenden von Tastenkombinationen im Emacs zum täglichen Brot gehört, werden folgende Abkürzungen verwendet:

C-x steht für <Control> x, bzw. <CTRL> x.
M-x steht für <Meta> x. Auf simpleren Terminals muss statt <Meta> die ESC (Escape) Taste verwendet werden.
<RET> steht für die "Enter"-taste. Sie schliesst häufig Befehle im Emacs ab, was aber selten erwähnt wird.

Im Emacs werden spezielle Modi (="Modusse") verwendet. Das heisst, je nach Applikation (Mail, LaTeX, ESS (mehr unter R und S im Emacs), ...) befindet sich ein Buffer in einem Modus, wo Emacs zusätzliche Tastenkombinationen zur Verfügung stellt, die für die Applikation speziell nützlich sind.

Tipp

Mit C-h m bekommt man in jedem speziellen Modus Hilfs-Informationen und auch alle Tastenbelegungen (Zuordnung aller Funktions-Tasten und <CTRL> und <Meta> Kombinationen).

Unter X-windows, (siehe auch X11), kann man mit der Maus arbeiten. Dies ist zunächst um "point" zu positionieren, dann aber auch für "Cut and Paste" mittels Maus-Klicks sehr nützlich. Will man eine Region löschen oder kopieren, die grösser als eine Seite ist, geht man folgendermassen vor:
  1. Gehe an den Anfang der Region und setze eine Marke mit C-<SPACE>
  2. Positioniere den Cursor am Ende der Region. Damit ist die Region bestimmt (kontrollieren mittels zweimaligem C-x C-x, welches "point" und "mark" vertauscht). Mit C-w löscht man die Region (= cut) und mit M-w speichert man sie in einen Zwischenspeicher (= copy).
  3. Will man den Zwischenspeicher an einem anderen Ort wieder einfügen, positioniert man dort den Cursor und drückt C-y (= paste).

Page URL: https://wiki.math.ethz.ch/bin/view/SfSInfo/EmacsAllgemeines
2024-03-29
© 2024 Eidgenössische Technische Hochschule Zürich