MacOS – Change Replace keyboard shortcut in Gedit

keyboardmacos

I'm a Linux user trying to get used to Mac. I've already swapped the Command and Control keys around.

I'm using Gedit in Mac now, and the replace key combination I'm used to (ControlH) is hiding the Window.

I've been using Karabiner to remap keys, and have been trying to figure out private.xml syntax to remap this how I want it to behave.

Here's what I have so far (not working):

<?xml version="1.0"?>
<root>
  <item>
     <name>Change Control-H (Command-H Hide in Mac) to Replace for gEdit (Control-Alt-F)</name>
     <identifier>private.control_h_to_replace</identifier>
     <autogen>__KeyToKey__ KeyCode::H, VK_COMMAND | ModifierFlag::OPTION_L, VK_COMMAND,KeyCode::F</autogen>
  </item>
</root>

I've also tried to remap it using Mac's settings > keyboard > shortcuts.

The Mac keyboard is driving me batty.

Best Answer

Your syntax for Karabiner is off.

This will work. Note that, like @klanomath, I have no idea if you're actually trying to use Command-H or Control-H, so you may need to change COMMAND_L to CONTROL_L on the third line.

        <autogen>
            __KeyToKey__
            KeyCode::H, ModifierFlag::COMMAND_L,
            KeyCode::F, ModifierFlag::CONTROL_L, ModifierFlag::OPTION_L
        </autogen>

It also now occurs to me that in your version, within the code, your replacement command is Command-Option-F as opposed to Control-Option-F as specified in the name. So you might need to adjust CONTROL_L to COMMAND_L on the fourth line.