Custom key bindings in Linux

Source: Internet
Author: User
Keywords Linux Key Bindings
Tags change command line course custom default etc file it is

You can change the key bindings by modifying the/etc/inputrc file. It is recommended that you use the default key bindings to avoid unnecessary annoyance. Of course, Emacs-style key bindings are generic and can be used at any time.

Add the row to the file to set the ReadLine key binding to VI style. (The software that uses readline, such as Bash, Lftp, is also in effect)

Set Editing-mode VI

Find this line:

$if Mode=emacs

Add the following below it

"\c-o": Menu-complete

# # #这两行不是必须的, depending on the situation ###
"\c-p": non-increhttp://www.aliyun.com/zixun/aggregation/29845.html ">mental-reverse-search-history
"\c-n": non-incremental-forward-search-history

Re-log in to the shell, and you can use \c-o (ctrl) to traverse the completion. If your file name is Chinese, or if there is garbled, you can use \m-* to put all the file names into the command line, and then delete the redundant, this is a great trouble! So you can use the \c-o traversal completion to put all possible options in turn into the command line.

Or use the Vim editor to edit the/etc/inputrc file and use Ctrl + V in insert mode. Press CTRL, the edit area adds a ^o character, equivalent to \c-o

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.