5 Replies Latest reply: Feb 23, 2013 12:56 PM by differenceclouds
oh kine Level 1 (5 points)

Just noticed this:

 

I want to change the TextEdit command Edit > Paste and Match Style from its obnoxious default shortcut to something else. I was successfully able to do this in Snow Leopard, but nothing happens when i try to do it in Lion.

 

Steps to reproduce:

 

1. Go to System Preferences > Keyboard > Keyboard Shortcuts

 

2. Add a new Application Shortcut for TextEdit.app

 

3. Menu Title is 'Paste and Match Style', Keyboard Shortcut can be anything (i'm trying to set Cmd+Shift+V)

 

4. Click Add

 

5. Switch back to TextEdit

 

6. No effect at all

 

I have tried this with multiple menu commands and multiple keyboard shortcuts, they all act the same. Changing shortcuts in other applications works fine and the shortcuts update instantly.

 

I also note that System Preferences is adding the appropriate keys to TextEdit's plist in my ~/Library:

 

<key>NSUserKeyEquivalents</key>

<dict>

    <key>Paste and Match Style</key>

    <string>@$v</strong>

</dict>

 

It simply ignores it.

 

I have had a friend confirm this on his own compuer as well; we're both running 10.7.2.

 

Is anyone else experiencing this? Is there a way around it?

 

cheers


iMac Intel, Mac OS X (10.7.2)
  • profinite Level 1 (0 points)

    I have had exactly the same experience in all iterations of Lion, including 10.7.4, as of this writing (May 22, 2012). I am trying to assign the same key combination as yours to the menu command, too.

  • oh kine Level 1 (5 points)

    I haven't been able to fix this problem itself, but i did discover a way around it: Cocoa's pasteAsPlainText key binding thing. The benefit of this is that it enables equivalent functionality in almost ALL Cocoa applications. You can find my key bindings file (with instructions) below; the relevant line in this case is the one near the bottom under the 'misc' section.

     

    https://github.com/ohkine/configs/blob/master/KeyBindings/DefaultKeyBinding.dict

     

    (Note that the shortcut i've set in my file can interfere with some terminal applications, so you have to decide what the best shortcut is for you. Since i don't use ^v in terminal it doesn't bother me)

     

    Hope that helps!

  • CalPolyGrad Level 1 (10 points)

    I had this problem and was finally able to find a solution.  I first tried the keyboard shortcut method that you described, but it didn't work for me.  Finally I found a link to a page that had usefull information about creating keyboard shortcuts from the command line (http://www.mactipper.com/2008/02/add-keyboard-shortcuts-from-command.html). With that info I was able to create the shortcut successfully.

     

    I wanted my shortcut to be shift+command+V, so from the terminal type this command:

     

    defaults write com.apple.TextEdit NSUserKeyEquivalents '{"Paste and Match Style"="@$v";}'

     

    I'm not sure if you need to restart TextEdit afterwards, but I did anyways.  After that it worked perfectly!

     

    Hope this helps!


    Frank

  • profinite Level 1 (0 points)

    Thank you so much, CalPolyGrad, for your help.

     

    Yes, it does work and my TextEdit now shows the shortcut with the keyboard shortcuts that I have always wanted.

  • differenceclouds Level 1 (0 points)

    Hello! I am trying to use this technique to change zoom in and out to Cmd + & Cmd - . It works for one or the other, but not both. It has something to do with the fact that this is already bound to commands for making highlighted text bigger and smaller. It successfully works for changing one, but when you change the other, it switches the first back to what it was before. I hope I explained this clearly it's weird.