How to customize Cocoa style hotkeys in Mac Terminal.app?

I love the cocoa style keyboard shortcuts and I am constantly frustrated that Terminal doesn't behave the same. Does anyone know how to set common cocoa -line 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 prevents you from using a command key. It also prevents you from specifying a key to "delete", but for some reason allows you to "forward delete" (?).

The main ones are:

  • Option+ / to move cursor to full word
  • Command+ / to go to start / end of line
  • Option+ Delto remove a complete word
  • Command+ Delto delete a line

If I could just get them I would be happy :-)

+2


source to share


2 answers


I read the instruction in this blog post from Allan Odgaard (from the glory of TextMate) to set up:

  • opt-arrow to move words
  • ctrl-arrow to go to start / end of line (although, to be honest, I use ctrl-a and ctrl-e more)
  • forward-delete (based on this comment which talks about mapping it to ctrl-opt-d)


You can also check the "Use as Meta Key" item to get the delete option to perform word deletion.

Unfortunately, as Allan says, you cannot bind to a normal delete key, and you cannot use a command key as a modifier.

+3


source


You can use the ones in the Unix terminal (shell), I think they work the same in a Terminal application:



  • full word forward: Esc+F

  • full word back: Esc+B

  • end of line: Ctrl+E

  • start of line: Ctrl+A

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

  • remove the entire command line: Ctrl+C

+1


source







All Articles