Skip to Main Content
Learning GNU Emacs, 3rd Edition
book

Learning GNU Emacs, 3rd Edition

by Debra Cameron, James Elliott, Marc Loy, Eric S. Raymond, Bill Rosenblatt
December 2004
Beginner to intermediate content levelBeginner to intermediate
536 pages
19h 28m
English
O'Reilly Media, Inc.
Content preview from Learning GNU Emacs, 3rd Edition

Indenting Text

Emacs provides the ability to indent paragraphs, like a block quote in a paper. It also allows you to use a paragraph style that indents just the first line of a paragraph. This section describes indentation-related commands, including how to change the margins for the current session.

Before we start, make sure you're in text mode. Look at the mode line and, if the word Text is displayed, you are in text mode. If not, type M-x text-mode Enter to enter text mode.

Indenting Paragraphs

Let's say you're writing a paper and want to include some indented block quotes. Emacs's default behavior makes this a no-brainer.[2] After you finish your first paragraph, use tabs or spaces to indent to the desired level and start typing the quote. Emacs automatically fills the paragraph and the quote correctly, as shown in the following screen.

Some indented text:

image with no caption

Emacs indents the text properly and fills it correctly in auto-fill mode.

What if an indented quote has multiple paragraphs? You could just press Enter and then Tab again at the beginning of subsequent paragraphs or you could press C-j (for newline-and-indent). Pressing C-j twice gives you a blank line between paragraphs.

Indenting the First Line of a Paragraph

Some people prefer paragraphs in which the first line is indented. Knowing about the intricacies of tabs, you might be concerned that pressing Tab to indent the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 7th Edition

Learning the vi and Vim Editors, 7th Edition

Arnold Robbins, Elbert Hannah, Linda Lamb
Mastering Vim

Mastering Vim

Ruslan Osipov
Modern Vim

Modern Vim

Drew Neil

Publisher Resources

ISBN: 0596006489Supplemental ContentErrata Page