24Chapter2 • Working With Editors
have typed in, pressing the
will cycle through the names. You can press
to select the one currently displayed.
Emacs supports the use of parenthetical statements in regex search and replace commands.
A portion of the search string may be used as part of the replacement string. The contents of the
first set of parenthesis in the search string may be referenced as \1 in the replacement string. The
second set would be referred to by \2.
For example:
Original string:The Dodo and the Griffin
Search string:\([Tt]h\)e \([a-zA-Z]*\)
Replacement string:\1ose \2s
New string:Those Dodos and those Griffins
Cutting and Pasting
Sections of the buffer may be marked and certain commands may be applied to those
regions. These commands include copying, cutting and pasting text. To select a region of text,
move the pointer to the beginning of the sections that you wish to select and press ^<
SPACE-
BAR>
. When the pointer is moved, the text from the marked point to the current pointer position
will be highlighted. Once the region is selected, issue the cut or copy command. To deselect the
text without issuing the copy or paste command, simply press
^
again.
Table 2-7 shows a list of the various selection commands.
2.2.3Using Buffers and Windows
As mentioned, Emacs has multiple buffers that can be opened and edited simultaneously.
To navigate between buffers, press
^Xb
and type the name of the buffer that you wish to switch
to. Buffers may be opened and closed by using the File Commands listed earlier in this chapter.
To see a list of buffers, use
^X^B
.
As shown in Figure 2-2, each window may be split into two windows by using the
^X2
command. This will create a horizontal divide in the middle of the current window. The same
file will be present in each pane, but they may be scrolled separately. To move between win-
dows, press
^Xo
. Windows may be split multiple times. To close all other buffer, use
^X1
. The
current buffer may be closed with
^X0
.
Table2-7 Cut and Paste Commands
ActionCommand
^Begin selection
^WCut
M-WCopy
^YPaste
Next Page >>
<< Previous Page
Back to the Table of Contents