Emacs Editor
Emacs Editor
Emacs EDITOR
• GNU Emacs, describes it as ” the extensive, customizable, self-
documenting, real-time display editor”.
• Emacs has many build-in commands and its user interface allows
the user to combine these commands into macros to automate work
Features of Emacs
• The <Esc> key can be typed by itself (because it really is a character) and then
followed by another character, the <Ctrl> key must be held down while the
next character is being typed. The conventions for describing these characters
(since it takes too long to type out the whole thing) are ESC means <Esc> and
C- means <Ctrl>
Basic Commands
• One other distinction between emacs and vi is that emacs allows you
to edit several files at once. The window for emacs can be divided
into several windows, each of which contains a view into a buffer.
Each buffer typically corresponds to a different file. Many of the
commands listed below are for reading files into new buffers and
moving between buffers.
• If the file named filename exists, then the first screen's worth of the
file is displayed; if it doesn't exist, a help message is displayed
Exciting Emacs command
• You can insert an ordinary graphic character (e.g., 'a', 'B', '3', and ‘=‘) by
typing the associated key. This adds the character to the buffer at point.
Insertion moves point forward, so that point remains just after the inserted
text.
• To end a line and start a new one, type RET (newline). (The RET key may be
labeled Return, or Enter, or with a funny-looking left-pointing arrow on your
keyboard).
1 C-x C-f Find-file: first prompts for a filename and then loads that file into a editor
buffer of the same name.
2 C-x C-s Save-buffer: saves a buffer into the associated filename
3 C-x C-w Write-namefile: prompts for a new filename and writes the buffer into it
Cursor/Screen Movement Commands
1 C-s Isearch-forward: prompts for next string and then searches from the current
cursor position forwards in the buffer
2 C-r isearch-backwards: like isearch-forward, but searches from the current
cursor position to end of buffer for text string
3 ESC % Query-replace: prompts for a search string and a string with which to
replace the search string
Thank you