Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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

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

<?xml version="1.0"?>
<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>

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
share|improve this answer
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. – jasongregori Jan 16 '13 at 22:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.