0% found this document useful (0 votes)
16 views13 pages

Emacs Editor

Uploaded by

phantomgamer099
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views13 pages

Emacs Editor

Uploaded by

phantomgamer099
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Emacs EDITOR

Emacs EDITOR
• GNU Emacs, describes it as ” the extensive, customizable, self-
documenting, real-time display editor”.

• It was created by David A.Moon, Guy L.steele Jr., Richard


M . Stallman

• 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

• Emacs is primarily a text editor and is designed for manipulating


pieces of text, although it is capable of formatting and printing
documents like a word processor by interfacing with external
programs such as LaTeX, Gostscript or a web browser

• Emacs provides commands to manipulate and differentially display


semantic units of text such as words, sentences, paragraphs and
source code constructs such as functions

• It also features keyboard macros for performing user-defined batches


of editing commands
Basic Commands
• Every command has a name chosen by a programmer. The name is
usually made of a few English words separated by dashes; for
example, next-line or forward-word. The bindings between keys
and commands are recorded in tables called Keymaps.

• Commands in emacs are either control characters (hold down the


<Ctrl> key while typing another character) or are prefixed by one of
a set of reserved characters: <Esc> or <Ctrl>-X.

• 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.

• To use emacs on a file, type


emacs filename

• 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

• C-x C-c Kill Emacs (save-buffers-kill-terminal).

• C-z On a text terminal, suspend Emacs; on a graphical display,


"minimize the selected frame (suspend-frame).

• Killing Emacs means terminating the Emacs program


Interesting Text commands

• 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).

• To insert a non-graphic character, or a character that your keyboard does not


support, first quote it by typing C-q (quoted-insert).
Interesting Text commands

• There are two ways to use C-q:


1. C-q followed by any non-graphic character (even C-g) inserts that character.
For instance, C-q DEL inserts a literal 'DEL' character
2. C-q followed by a sequence of octal digits inserts the character with the
specified octal character code. You can use any number of octal digits; any
non-digit terminates the sequence. If the terminating character is RET, that
RET serves only to terminate the sequence. Any other non-digit terminates
the sequence and then acts as normal input-thus, C-q101B inserts “AB”

• To use decimal or hexadecimal instead of octal, set the variable read-quoted-


char-radix to 10 or 16. If the radix is 16, the letters a to f serve as part of a
character code, just like digits. Case is ignored
File Reading and Writing Commands

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-a Move cursor to(at)beginning of line


2 C-e Move cursor to end of line
3 C-f Move cursor forward one character
4 C-b Move cursor backward one character
5 C-n Move cursor to next line
6 C-p Move cursor to previous line
7 C-v Scroll file forward by one screenfull
8 ESC v Scroll file backward by one screenfull
9 ESC < Go to beginning of buffer
10 ESC > Go to end of buffer
11 ESC f Move cursor forward one word
12 ESC b Move cursor backward one word
Copy and delete commands

1 C-d Delete-char: delete character under cursor


2 ESC d Delete-word: delete from cursor to end of word immediately ahead of the
cursor
3 C-k Kill-line: delete the rest of the current line
4 C-@ Set-mark-command: mark is used to indicate the beginning of an area of
text to be yanked
5 C-w Kill-region: delete the area of text between the mark and the current cursor
position
6 C-y Yank: insert a current cursor location whatever was most recently deleted
7 ESC w Copy-region-as-kill: copy area between mark and cursor into kill-buffer so
that it can be yanked into someplace else
Search 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

You might also like