44

GNU Readline Library Reference

 4 years ago
source link: https://gnureadline-reference.herokuapp.com/reference/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Entering Input Mode

i Insert before cursor.
a Insert after cursor.
I Insert at the beginning of line.
A Insert at the end of line.
c<movement command> Change text of a movement command.
C or c$ Change text to the end of line.
cc or S or 0c$ Change current line.
s or c[SPACE] Delete a single charecter under the cursor and enter input mode.
r Replace a single charecter under the cursor(without leaving the command mode).
R Replace characters under the cursor.
v Edit(and execute) the current command in a text editor(an editor in $VISUAL and $EDITOR variables or vi).

Moving

l or SPACE Move one character right.
h Move one character left.
w Move one word/token right.
b Move one word/token left.
W Move one non-blank word right.
B Move one non-blank word left.
e Move to the end of the current word.
E Move to the end of the current non-blank word.
0 Move to the beginning of line.
ˆ Move to the first non-blank character of line.
$ Move to the end of line.
% Move to the corresponding opening/closing bracket (()’s, []’s and {}’s).

Searching

fc Move right to the next occurance of c.
Fc Move left to the previous occurance of c.
tc Move right to the next occurance of c, then one char backward.
Tc Move left to the previous occurance of c, then one char forward.
; Redo the last character finding command.
, Redo the last character finding command in opposite direction.
| Move to the n-th column (you may specify the argument n by typing it on number keys, for example, 20|).

Deleting

x Delete a single character under the cursor.
X Delete a character before the cursor.
d<movement command> Delete text of a movement command.
D or d$ Delete to the end of the line.
dd or 0d$ Delete current line.
Ctrl-w Delete the previous word.
Ctrl-u Delete from the cursor to the beginning of line.

Undo/Redo

u Undo previous text modification.
U Undo all previous text modifications on the line.
. Redo the last text modification.

Yanking and Pasting

y<movement command> Yank a movement into buffer).
yy Yank the whole line.
p Insert the yanked text at the cursor).
P Insert the yanked text before the cursor.

History

k Move backward one command in history.
j Move forward one command in history.
G Move to the history line n (you may specify the argument n by typing it on number keys, for example, 15G).
/string or Ctrl-r Search history backward for a command matching string.
?string or Ctrl-s Search history forward for a command matching string (remember that on most machines Ctrl-s stops the output to the terminal (Ctrl-q starts output) and you.
n Repeat search in the same direction as previous.
N Repeat search in the opposite direction as previous.

Completing

TAB or Ctrl-i or = List possible completions.
* Insert all possible completions.

Miscellaneous

Invert the case of the character under cursor, and move a character right.
# Prepend # (comment character) to the line and send it to the history list.
_ Inserts the n-th word of the previous command in the current line.
0, 1, 2, ... Sets the numeric argument.
Ctrl-v Insert a character literally (quoted insert).
Ctrl-t Transpose (exchange) two characters.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK