3

I know I can do control+a but I want command+left. I'm using the fish shell.

I tried creating an apple script to call control+a when I hit command+left but that caused it to call command+control+a which didn't work.

4
  • Does fish use readline? If so, when you enter the read command, and then press ⌘←, what does it output?
    – slhck
    Jan 15, 2013 at 20:37
  • Is that a command line utility? I tried typing in readline but fish didn't recognize the command. Jan 15, 2013 at 21:00
  • No, read, not readline :)
    – slhck
    Jan 15, 2013 at 21:00
  • I get nothing. command+left makes terminal switch between windows. But command+anything does nothing. Jan 15, 2013 at 21:05

1 Answer 1

3

Using KeyRemap4MacBook, you could save this as private.xml:

<?xml version="1.0"?>
<root>
<item>
<name>test</name>
<identifier>private.test</identifier>
<only>TERMINAL</only>
<autogen>--KeyToKey-- KeyCode::CURSOR_LEFT, VK_COMMAND, KeyCode::A, ModifierFlag::CONTROL_L</autogen>
<autogen>--KeyToKey-- KeyCode::CURSOR_RIGHT, VK_COMMAND, KeyCode::E, ModifierFlag::CONTROL_L</autogen>
<autogen>--KeyToKey-- KeyCode::DELETE, VK_COMMAND, KeyCode::U, ModifierFlag::CONTROL_L</autogen>
<autogen>--KeyToKey-- KeyCode::FORWARD_DELETE, VK_COMMAND, KeyCode::K, ModifierFlag::CONTROL_L</autogen>
</item>
</root>

I couldn't figure out how to change command+fn+delete to C-k.

There's also a predefined setting in terminal.xml, but it only works with the left command, and it includes other remappings that aren't really needed anymore.

You can make ⌥⌦ delete a word forward by adding this to ~/.inputrc:

"\e(": kill-word
1
  • This is awesome. Thank you Lauri. I would prefer to be able to do this without something hacky but this is working really well. And the option forward delete is an added bonus. Jan 16, 2013 at 22:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .