user169466
user169466

Reputation: 21

How can I set up Cocoa style keyboard shortcuts in Mac Terminal.app?

I love cocoa style keyboard shortcuts and am constantly frustrated that Terminal doesn't behave in the same way. Does anyone know how to set common cocoa-style keyboard shortcuts in Terminal.app?

I found a blog post that describes how to do this in iTerm: http://blog.jcoffin.com/2008/12/06/mac-keyboard-shortcuts-iterm/. However, I like Terminal.app better for a number of reasons.

Terminal.app allows you to define custom keyboard shortcuts, but it doesn't let you use the command key. It also doesn't let you define a key for "delete", but for some reason allows "forward delete" (?).

The main ones I want are:

If I could just have these I would be happy :-)

Upvotes: 2

Views: 1312

Answers (2)

stefanB
stefanB

Reputation: 79930

You could use the ones from Unix terminal (shell), I think they work the same in Terminal app:

  • full word forward: Esc + F

  • full word backward: Esc + B

  • end of the line: Ctrl + E

  • beginning of the line: Ctrl + A

  • delete full word (cursor at the end of the word): Esc + Backspace (Mac Del?)

  • delete the whole command line: Ctrl + C

Upvotes: 1

Kelan
Kelan

Reputation: 2276

I followed the instructions in this blog post from Allan Odgaard (of TextMate fame) to set up:

  • opt-arrow for word-movement
  • ctrl-arrow for moving to start/end of the line (though, to be honest, I end up using ctrl-a and ctrl-e much more often)
  • forward-delete (based on this comment which says to map it to ctrl-opt-d)

You can also check the "Use option as meta key" item to get opt-delete to perform word-deletion.

Unfortunately, as Allan says, you cannot bind to the normal delete key, nor can you use the Command key as a modifier.

Upvotes: 3

Related Questions