Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 down vote accepted

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
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

 
discard

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.