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.

The shortcut + normally deletes a line of text in a text field. But in the new Messages app in Mountain Lion, this is the shortcut for "Close Conversation…" (or, if you choose "Save history when conversations are closed" in the preferences, it's "Delete Conversation…").

Is there a way to disable this shortcut such that + can again be used for deleting text?

share|improve this question

5 Answers 5

You can change the shortcut for "Close Conversation" to something else, that should avoid the conflict. To do this, open Keyboard Preferences, and then go to the "Keyboard Shortcuts" tab. Click Application Shortcuts, then the + button to add a new one. You should get a popup like this one (I'm still on Lion, but I don't believe they changed much): New Keyboard Shortcut

Change the application to Messages, enter the proper menu title (if it uses an ellipsis, you may have to enter that exact character — not just three periods — by hitting optionshift;), then enter in a shortcut you're unlikely to use.

It's also possible to disable a keyboard shortcut from the command line, rather than just setting it to some obscure command. However I haven't tested this on Mountain Lion or Messages app, so no guarantees.

If you're comfortable with the command line, the proper command would likely be defaults write com.apple.Messages NSUserKeyEquivalents -dict-add "Close Conversation…" nil. However I don't have access to Mountain Lion, so the com.apple.Messages part is just a guess. You may want to test first by trying defaults read com.apple.Messages and see if it pops up with an error. It should spit out a long list of plist-formatted preferences, if it doesn't the app identifier (com.apple.Messages) is probably wrong, so you'll need to do some digging to find out what it is.

Again let me stress that I haven't tested this second option on Mountain Lion or Messages at all, it's just based on how things work in previous versions of OS X.

share|improve this answer
    
Is it possible to use the ⌫ key in a custom shortcut? I'm having trouble using something like ⇧⌥⌫. –  jtbandes Jul 26 '12 at 20:25
    
See my answer, just gotten it to work. It's com.Apple.iChat. –  Moshe Jul 26 '12 at 20:36
    
The Terminal method is a great idea, but doesn't work. It seems to automatically change a nil shortcut to "L". –  jtbandes Jul 26 '12 at 21:09
    
Really? Didn't try pressing l. –  Moshe Jul 26 '12 at 21:44
    
If you look in System Preferences, it does list any nil shortcut as L, but that's just some quirk in System Prefs, pressing L shouldn't activate anything. The exception is in some cases (seems to be when you install a new version of an app), it will reset it so that L actually activates the item, in which case just execute the defaults command again. –  robmathers Jul 26 '12 at 21:48
  1. Quit Messages.
  2. Open a terminal window and do:

    defaults write com.Apple.iChat NSUserKeyEquivalents -dict-add "Close Conversation…" nil
    

    Note that's a real ellipses character, either type ; or just copy/paste from here.

  3. Re-start Messages. Both Command-Delete () and Option-Delete () will now work as editing commands.

share|improve this answer
    
Thanks to Moshe, MattiSG, and CanuckSkier for putting me on the right track. Unfortunately there was no single answer here that had just the correct information in a simple, straight-forward form. –  Frank Szczerba Dec 5 '12 at 15:25

Control-K deletes the selection, or if there is no selection to the end of the current line. This works in any true Cocoa text view.

share|improve this answer
    
There's no opposite (delete to beginning), is there? I guess to use this I would have to do ⌘←, ⌃K. –  jtbandes Jul 26 '12 at 20:27
    
Just hold down the delete key? Command-Shift-Left selects to the beginning of the line, then delete or control-K or control-H. –  Mark Jul 26 '12 at 20:36

I use + Shift + Left to select all the text on the line and then hit . To select all the text, I'd substitute that with + A. It's not perfect, but it works.

Edit:

Based on CanuckSkier's answer, I've gotten the delete conversation message to
go away with the following command on the Terminal:

defaults write com.Apple.iChat NSUserKeyEquivalents -dict-add "Close Conversation…" nil

It's also a little cleaner than using the System Preferences method, because you have no command instead of an extra obscure one.

share|improve this answer
    
I don't want to delete all the text but just a single line. (And for that, instead of ⌘⇧↑, I'd use ⌘A.) –  jtbandes Jul 26 '12 at 20:10
    
Well, that or left. –  Moshe Jul 26 '12 at 20:11
    
@jtbandes Edited Command + Shift + Left selects the entire line. –  Moshe Jul 26 '12 at 20:13
    
Ah, I see what you mean. That's a valid substitute but I'm going to keep hoping for a real solution :) –  jtbandes Jul 26 '12 at 20:14
    
Ok, cool. Good luck. If I find anything, I'll post it. –  Moshe Jul 26 '12 at 20:16

Open System Preferences > Keyboard > Keyboard Shortcuts.

Quit Messages if it is opened. Click the + at the bottom of the list on the right. In the pop-up, select the “Messages” application, enter Close Conversation… (with proper ellipsis, as @CanuckSkier stressed) in “Menu Title”. In “Keyboard Shortcut”, type ⌥⇧a, for example. We'll redefine the “a” right after.

Open ~/Library/Preferences/com.apple.iChat.plist with your favorite text editor (it can even be TextEdit), and look for (⌘F) NSUserKeyEquivalents. You should find the string ~$a somewhere nearby, which is our encoded previously-defined shortcut. Simply replace the “a” with the special character “⌫” (you can copy-and paste it from this post). Save the file.

This should do the trick to define ⌥⇧⌫ as the shortcut :)

share|improve this answer

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.