Chapter 29. Command Line Editing
293
29.2.3. Readline Killing Commands
Killing
text means to delete the text from the line, but to save it away for later use, usually by
yanking
(re-inserting) it back into the line. (‘Cut’ and ‘paste’ are more recent jargon for ‘kill’ and ‘yank’.)
If the description for a command says that it ‘kills’ text, then you can be sure that you can get the text
back in a different (or the same) place later.
When you use a kill command, the text is saved in a
kill-ring
. Any number of consecutive kills save
all of the killed text together, so that when you yank it back, you get it all. The kill ring is not line
specific; the text that you killed on a previously typed line is available to be yanked back later, when
you are typing another line. Here is the list of commands for killing text.
C-k
Kill the text from the current cursor position to the end of the line.
M-d
Kill from the cursor to the end of the current word, or, if between words, to the end of the next
word. Word boundaries are the same as those used by
M-f
.
M-[DEL]
Kill from the cursor the start of the current word, or, if between words, to the start of the previous
word. Word boundaries are the same as those used by
M-b
.
C-w
Kill from the cursor to the previous whitespace. This is different than
M-[DEL]
because the
word boundaries differ.
Here is how to
yank
the text back into the line. Yanking means to copy the most-recently-killed text
from the kill buffer.
C-y
Yank the most recently killed text back into the buffer at the cursor.
M-y
Rotate the kill-ring, and yank the new top. You can only do this if the prior command is
C-y
or
M-y
.
29.2.4. Readline Arguments
You can pass numeric arguments to Readline commands. Sometimes the argument acts as a repeat
count, other times it is the
sign
of the argument that is significant. If you pass a negative argument to a
command which normally acts in a forward direction, that command will act in a backward direction.
For example, to kill text back to the start of the line, you might type
M- C-k
.
The general way to pass numeric arguments to a command is to type meta digits before the command.
If the first ‘digit’ typed is a minus sign (
-
), then the sign of the argument will be negative. Once you
have typed one meta digit to get the argument started, you can type the remainder of the digits, and
then the command. For example, to give the
C-d
command an argument of 10, you could type
M-1 0
C-d
, which will delete the next ten characters on the input line.
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......