How can I map control-underscore to zoom out in gnome terminal?

Solution 1:

Once I understood that this question was about gnome-terminal (by reading the tags) the answer became obvious. In this example I used your alternate setup of Ctrl+ and Ctrl- with the numeric pad because I'm used to doing that in Firefox and Nautilus. It also avoids the use of the Shift key entirely. The same principles apply however, and you can change the mappings however you desire with this approach.

Choose Edit->Keyboard Shortcuts and scroll down and select the View parameter you wish to change (In my case I clicked Zoom In as shown below)

kbd-shrtcut

Click on the existing shortcut key combination to the right of the Action (in the Shortcut key column). The text will change to "New accelerater..."

Use the key combination you wish to use for that function. and the text will change to indicate the key combination that you used. (If you used the NumPad for the same combo it will respond to that although the difference may not be visable in the window above)

Repeat as necessary to adjust any terminal shortcuts you want to meet your desires.

Edit:

Further testing indicates that as @egmont stated in his comment the shortcut keys are global and any changes made to them will apply to all terminal profiles.

Sources:

https://help.gnome.org/users/gnome-terminal/stable/adv-keyboard-shortcuts.html.en

https://help.gnome.org/users/gnome-terminal/stable/pref.html.en

Testing on Ubuntu 14.04, 16.04

Solution 2:

You can do this through the CCSM interface pretty easily.

  1. Install the CompizConfig Settings Manager if you don't have it:

    sudo apt install compizconfig-settings-manager
    
  2. You will also need xdotool if you don't have it:

    sudo apt install xdotool
    
  3. Launch CCSM by pressing Alt + F2, typing ccsm, and hitting Enter.

  4. Click on the "Commands" button at the top of the window.

  5. Add the following command to one of the open slots. Make note of the slot ID.

    xdotool key --clearmodifiers ctrl+minus
    
  6. Switch to the "Key Bindings" tab (top of the window).

  7. Select the appropriate binding and Enable it.
  8. Hit Grab Key Combination and then press your desired key combination.
  9. If the Shift modifier is green, click it to disable. Make sure your final selection looks like this:

  1. Hit OK. Your zoomout keybind should be active.

Notes:

  1. You will lose the ability to use whatever keybind you assigned to act as zoom-out.
  2. This solution will only work for Compiz-based WMs, like Unity.

Solution 3:

As already someone has mentioned please try this link for modifying the default shortcut with the Ubuntu system settings.

Below are the same steps from above Ubuntu link:

Set keyboard shortcuts - To change the key or keys to be pressed for a keyboard shortcut:

  1. Click the icon at the very right of the menu bar and select System Settings.
  2. Open Keyboard and select the Shortcuts tab.
  3. Select a category in the left pane, and the row for the desired action on the right. The current shortcut definition will change to New accelerator…
  4. Hold down the desired key combination, or press Backspace to clear.

Custom shortcuts - To create your own keyboard shortcut:

  1. Select Custom Shortcuts in the left pane, and click the + button (or click the + button in any category). The Custom Shortcut window will appear.

  2. Type a Name to identify the shortcut, and a Command to run an application, then click Apply. For example, if you wanted the shortcut to open Rhythmbox, you could name it Music and use the rhythmbox command.

  3. Click Disabled in the row that was just added. When it changes to New accelerator…, hold down the desired shortcut key combination.

  4. The command name that you type should be a valid system command. You can check that the command works by opening a Terminal and typing it in there. The command that opens an application may not have exactly the same name as the application itself.

If you want to change the command that is associated with a custom keyboard shortcut, double-click the name of the shortcut. The Custom Shortcut window will appear, and you can edit the command.