Solution
Before I start with my solution, just a quick note here. Many of the commands you listed above (such as the Page Up/Down) don't have a .inputrc
variable. They also already have corresponding shortcuts (see below). Therefore, if you want to use a different shortcut, you will have to remap the menu item to a new one.
For Mac OS
Shortcuts
First of all, the Mac OS terminal has a built in keyboard shortcut for scrolling up and down the page: Command + ArrowKeyUp or Command + ArrowKeyDown. Below is a quick table highlighting some of the menu commands and their corresponding shortcuts in the Mac Terminal:
| Function | Shortcut |
+-------------------------+------------------------+
| Page Up | Command + Up |
+-------------------------+------------------------+
| Page Down | Command + Down |
+-------------------------+------------------------+
| Line Up | Shift + Command + Up |
+-------------------------+------------------------+
| Line Down | Shift + Command + Down |
+-------------------------+------------------------+
| Go to beginning of line | Control + A |
+-------------------------+------------------------+
| Go to end of line | Control + B |
+-------------------------+------------------------+
New Shortcuts
If you don't want to use the built-in shortcuts, you will have to create new ones. There are several ways to do this, but I think using the GUI (versus the CLI) is easier in this situation. On Mac OS, open System Preferences
, head to the Keyboard
section, and finally click open the Shortcuts
tab:
![Keyboard Shortcuts](https://cdn.statically.io/img/i.sstatic.net/QUZS6.png)
On the sidebar, click the App Shortcuts
tab. Below, you will find a +
button. Click that, and the following will pop up:
![Add Shortcut](https://cdn.statically.io/img/i.sstatic.net/pkBL2.png)
Choose Terminal from the dropdown menu, and type in the menu item and keyboard shortcut you want to map to it. Below is an example of mapping Page Up
to Shift + ArrowKeyUp:
![New Shortcut](https://cdn.statically.io/img/i.sstatic.net/1iO1u.png)
For Debian
Shortcuts
Like Mac OS, Debian already has all of the shortcuts you want built-in. Below is another table highlighting these shortcuts:
| Function | Shortcut |
+-------------------------+------------------------+
| Page Up | Shift + Up |
+-------------------------+------------------------+
| Page Down | Shift + Down |
+-------------------------+------------------------+
| Line Up | Shift + Control + Up |
+-------------------------+------------------------+
| Line Down | Shift + Control + Down |
+-------------------------+------------------------+
| Go to beginning of line | Control + A |
+-------------------------+------------------------+
| Go to end of line | Control + B |
+-------------------------+------------------------+
New Shortcuts
To create a new shortcut in Debian, use the GUI. Open up Settings
, head to Devices
, and then Keyboard
. The following will show up:
![New shortcut in Debian](https://cdn.statically.io/img/i.sstatic.net/H0yjJ.png)
Scroll down to the bottom, and click the +
button. A dialog box will show up with the entry fields:
Fill these out, click the blue Add
button, and you're done.