This section describes Readline commands that may be bound to key sequences. Command names without an accompanying key sequence are unbound by default.
In the following descriptions, point refers to the current cursor position, and mark refers to a cursor position saved by the set-mark command. The text between the point and mark is referred to as the region.
Move to the start of the current line.
Move to the end of the line.
Move forward a character.
Move back a character.
Move forward to the end of the next word. Words are composed of letters and digits.
Move back to the start of the current or previous word. Words are composed of letters and digits.
Clear the screen and redraw the current line, leaving the current line at the top of the screen.
Refresh the current line. By default, this is unbound.
Accept the line regardless of where the cursor is. If this line is non-empty, it may be added to the history list for future recall with add_history(). If this line is a modified history line, the history line is restored to its original state.
Move `back' through the history list, fetching the previous command.
Move `forward' through the history list, fetching the next command.
Move to the first line in the history.
Move to the end of the input history, i.e., the line currently being entered.
Search backward starting at the current line and moving `up' through the history as necessary. This is an incremental search.
Search forward starting at the current line and moving `down' through the the history as necessary. This is an incremental search.
Search backward starting at the current line and moving `up' through the history as necessary using a non-incremental search for a string supplied by the user.
Search forward starting at the current line and moving `down' through the the history as necessary using a non-incremental search for a string supplied by the user.
Search forward through the history for the string of characters between the start of the current line and the point. This is a non-incremental search. By default, this command is unbound.
Search backward through the history for the string of characters between the start of the current line and the point. This is a non-incremental search. By default, this command is unbound.
Insert the first argument to the previous command (usually the second word on the previous line) at point. With an argument n, insert the nth word from the previous command (the words in the previous command begin with word 0). A negative argument inserts the nth word from the end of the previous command.
Insert last argument to the previous command (the last word of the previous history entry). With an argument, behave exactly like yank-nth-arg. Successive calls to yank-last-arg move back through the history list, inserting the last argument of each line in turn.
Delete the character at point. If point is at the beginning of the line, there are no characters in the line, and the last character typed was not bound to delete-char, then return eof.
Delete the character behind the cursor. A numeric argument means to kill the characters instead of deleting them.
Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is deleted. By default, this is not bound to a key.
Add the next character typed to the line verbatim. This is how to insert key sequences like C-q, for example.
Insert a tab character.
Insert yourself.
Drag the character before the cursor forward over the character at the cursor, moving the cursor forward as well. If the insertion point is at the end of the line, then this transposes the last two characters of the line. Negative arguments have no effect.
Drag the word before point past the word after point, moving point past that word as well. If the insertion point is at the end of the line, this transposes the last two words on the line.
Uppercase the current (or following) word. With a negative argument, uppercase the previous word, but do not move the cursor.
Lowercase the current (or following) word. With a negative argument, lowercase the previous word, but do not move the cursor.
Capitalize the current (or following) word. With a negative argument, capitalize the previous word, but do not move the cursor.
Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only emacs mode; vi mode does overwrite differently. Each call to readline() starts in insert mode.
In overwrite mode, characters bound to self-insert replace the text at point rather than pushing the text to the right. Characters bound to backward-delete-char replace the character before point with a space.
By default, this command is unbound.
Kill the text from point to the end of the line.
Kill backward to the beginning of the line.
Kill backward from the cursor to the beginning of the current line.
Kill all characters on the current line, no matter where point is. By default, this is unbound.
Kill from point to the end of the current word, or if between words, to the end of the next word. Word boundaries are the same as forward-word.
Kill the word behind point. Word boundaries are the same as backward-word.
Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring.
Delete all spaces and tabs around point. By default, this is unbound.
Kill the text in the current region. By default, this command is unbound.
Copy the text in the region to the kill buffer, so it can be yanked right away. By default, this command is unbound.
Copy the word before point to the kill buffer. The word boundaries are the same as backward-word. By default, this command is unbound.
Copy the word following point to the kill buffer. The word boundaries are the same as forward-word. By default, this command is unbound.
Yank the top of the kill ring into the buffer at point.
Rotate the kill-ring, and yank the new top. You can only do this if the prior command is yank or yank-pop.
Add this digit to the argument already accumulating, or start a new argument. M- starts a negative argument.
This is another way to specify an argument. If this command is followed by one or more digits, optionally with a leading minus sign, those digits define the argument. If the command is followed by digits, executing universal-argument again ends the numeric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is neither a digit or minus sign, the argument count for the next command is multiplied by four. The argument count is initially one, so executing this function the first time makes the argument count four, a second time makes the argument count sixteen, and so on. By default, this is not bound to a key.
Attempt to perform completion on the text before point. The actual completion performed is application-specific. The default is filename completion.
List the possible completions of the text before point.
Insert all completions of the text before point that would have been generated by possible-completions.
Similar to complete, but replaces the word to be completed
with a single match from the list of possible completions.
Repeated execution of menu-complete steps through the list
of possible completions, inserting each match in turn.
At the end of the list of completions, the bell is rung
(subject to the setting of bell-style)
and the original text is restored.
An argument of n moves n positions forward in the list
of matches; a negative argument may be used to move backward
through the list.
This command is intended to be bound to
Deletes the character under the cursor if not at the beginning or end of the line (like delete-char). If at the end of the line, behaves identically to possible-completions. This command is unbound by default.
Begin saving the characters typed into the current keyboard macro.
Stop saving the characters typed into the current keyboard macro and save the definition.
Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard.
Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.
Abort the current editing command and ring the terminal's bell (subject to the setting of bell-style).
If the metafied character x is lowercase, run the command that is bound to the corresponding uppercase character.
Metafy the next character typed. This is for keyboards
without a meta key. Typing
Incremental undo, separately remembered for each line.
Undo all changes made to this line. This is like executing the undo command enough times to get back to the beginning.
Perform tilde expansion on the current word.
Set the mark to the point. If a numeric argument is supplied, the mark is set to that position.
Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark.
A character is read and point is moved to the next occurrence of that character. A negative count searches for previous occurrences.
A character is read and point is moved to the previous occurrence of that character. A negative count searches for subsequent occurrences.
Without a numeric argument, the value of the comment-begin variable is inserted at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if the characters at the beginning of the line do not match the value of comment-begin, the value is inserted, otherwise the characters in comment-begin are deleted from the beginning of the line. In either case, the line is accepted as if a newline had been typed.
Print all of the functions and their key bindings to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. This command is unbound by default.
Print all of the settable variables and their values to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. This command is unbound by default.
Print all of the Readline key sequences bound to macros and the strings they output. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. This command is unbound by default.
When in vi command mode, this causes a switch to emacs editing mode.
When in emacs editing mode, this causes a switch to vi editing mode.