GNU Readline Operation Reference (Bash/Emacs /...)

Source: Internet
Author: User

<Emacs_specific>
C-x C-C Exit Emacs! The most important Emacs command is :-)
</Emacs_specific>

Basic operations
C-B rollback 1 Character
C-F advances 1 Character
Del/backspace Delete characters on the left (#1)
C-d: Delete characters under the cursor
C-_/C-X c-u undo the last operation

#1: based on different configurations, the backspace key may be set to delete characters on the left of the cursor, while the Del key is the same as the c-d key to delete characters under the cursor.

Move cursor
C-a move to the beginning of the line
Move c-e to the end of the row
M-F forward a word (including numbers and letters)
M-B: Roll back a word.
C-l clears the screen and resends the current row at the top.

Killing operation
The killing operation deletes text from the current row and saves it for future pasting (yanking)
C-k deletes the remaining parts from the current position
M-D deletes the part from the cursor position to the end of the word. If the cursor is between words, the next word is deleted.
M-DEL: delete the part from the cursor position to the start of the word. If the cursor is between words, delete the previous word.
C-W deletes the part from the current position to the previous blank. Different from m-Del.

Yanking operation
C-y paste the last kill text to the cursor
M-y roll back and paste the record, and paste the new top one. The first command must be c-y or M-y.

Read Parameters
You can pass the numeric parameter to the Readline command. Format:
M-[-] digit command
Example:
M-1 0 c-d passed 10 to c-d, removing the 10 characters behind the cursor
M -- c-k pass-1 to c-k, delete the part before the cursor in the current row

Search for historical records
Two Methods: normal search and incremental search
Incremental search:
C-r searches forward (backward) in history records
C-s searches backward (forward) in history records
Repeated c-r/C-s will continue to find the next record
ESC/C-J: end the search and accept the search result as the current row.
Enter to end the search, accept the results, and execute
C-G exit the search and restore the current row

Excerpted and translated from "GNU Readline library users 'Manual"
Http://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.