Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am so used to using D to "delete-next-word" in emacs and xterm, that I automatically hit it in Terminal all the time, which rather annoyingly (to me, at least) causes the pane to split instead. I've tried to google solutions, but all I get are hits telling me what a neat feature this is.

I could just use XTerm under X11, but Terminal plays more nicely with some of my favorite Mac utilities (notably Divvy). I've tried iTerm2, but at best I can get it to ignore D, not actually erase the word.

Any ideas?

share|improve this question

3 Answers 3

I don't know how to bind D to M-d, but this would remove the shortcut of the Split Pane menu bar item:

defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add "Split Pane" nul
share|improve this answer
    
Hmm, this disables the shortcut for split pane, but it doesn't seem to delete the word –  Nathan Greenstein Oct 23 '11 at 15:16

Switch to iTerm2. It's free and sooo much nicer than plain old terminal. Also it has a lot more options for customization, like keyboard shortcuts.

Also I love that you can use cmd and 1-9 to switch between tabs. Try it and you will never go back to regular terminal :)

How to set up delete next word in iTerm 2

  1. Install iTerm2
  2. Launch and then go to preference pane.
  3. Choose the keyboard tab

iTerm 2

4. Click on the plus button to add a new keyboard shortcut
5. In the first box type CMD+D
6. In the second box choose "send escape code"
7. In the third box type the letter d

Picture.png

Voila! Now in iterm2 cmd+d will delete the word in front of the cursor.

See also http://stackoverflow.com/questions/81272/is-there-any-way-in-the-os-x-terminal-to-move-the-cursor-word-by-word/8250989#8250989

share|improve this answer

You can get 'meta-' in terminal using either 'escape' as a prefix, or using opt/alt as a shift key. I've not been able to find a way to use the command key, and none of my searches have turned up anything (with the exception of installing a key mapper); just the same complaint.

share|improve this answer
    
Install a key mapper to swap Option and Command in Terminal, then enable "Use Option as meta key". –  Chris Page Oct 24 '11 at 18:52

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.