How to define multiple hotkeys in inputrc

Source: Internet
Author: User
Article Title: how to define multiple hotkeys in inputrc. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
~ /. Inputrc
"\ M-H, \ C-H": "cd $ HOME"
"\ M-H; \ C-H": "cd $ HOME"
"\ M-H + \ C-H": "cd $ HOME"
"\ M-H & \ C-H": "cd $ HOME"
....
  
Any idea is greatly appreciated! 3KU very much!
  
Use cat to view the ASCII characters of the combined hot key:
# Cat
   <按下热键,如:ctrl-alt-h>
What do you see? ^ [^ H, right?
Press Exit
Likewise, we can find the ASCII characters corresponding to other combinations of hot keys, some combined hotkeys, such as Ctrl + Alt + D/Q/Z/C/S/M/J/U/I/E, seem to be unavailable, but it doesn't matter, there are about 15 available hotkeys
  
Then modify/etc/inputrc or ~ /. Inputrc, add the macro definition of the combination hot key to it, even as follows:
  
"^ [^ G": "gaim &>/dev/null & disown \ C-M"
# Press Ctrl-Alt-g to open gaim in the current shell and run it independently. That is, gaim does not close the character input method even if you exit the shell: in vi insertion mode, ^ [is to press Ctrl-V first, then ESC, [^ G is to press Ctrl-v first, and then press Ctrl-H. Others are similar to this
  
"^ [^ H": "vi/etc/httpd/conf/httpd. conf \ C-M"
# Ctrl-Alt-h Open the vi editor and edit the apache configuration file
  
"^ [^ L": "stardict &>/dev/null & disown \ C-M"
# Ctrl-Alt-l-> run the interstellar translation King (l-> look up query)
  
"^ [^ O": "soffice &>/dev/null & disown \ C-M"
# Ctrl-Alt-o-> open Openoffice
  
"^ [^ P": "opera &>/dev/null & disown \ C-M"
# Ctrl-Alt-p-> the famous browser Opera
  
"^ [^ X": "xmms &>/dev/null & disown \ C-M"
  
Test:
Su-
  
U see what? --- Xmms starts up

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.