4

I've noticed that Ctrl+Backspace/Option+Delete doesn't delete the word to the left of cursor in the MATLAB editor, as it does in many (most?) other editors and programs. This is intensely annoying, as I often will want to change a function name or small section of code. Currently I am forced to hold shift, use option+left, and then press delete to perform what should be a two keystroke operation.

Is there a way to enable it, or is a similar shortcut available? I found this unanswered question on MATLAB Central, but no further joy.

Edit:
Running R2010a on OSX

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Bill Cheatham
  • 11,396
  • 17
  • 69
  • 104

1 Answers1

4

Are you on R2010b?

At least on Windows, this is supported starting in R2010b. All the keyboard shortcuts are in File > Preferences, under Keyboard > Shortcuts. Type "word" in the search bar (the text field just above the list of actions) to see the word-level actions. In R2010b, but not earlier versions, there is a "Remove Previous Word" action, and in Windows it's bound by default to Ctrl+Backspace. Sounds like you're using Mac, too; I don't know what the default binding is there.

So, upgrade to R2010b, and maybe adjust the bindings under Keyboard > Shortcuts in Preferences.

This and some other keyboard shortcuts work in the editor but not in the command window. I don't know why. You might want to request that as an enhancement from MathWorks if you want it in the command window, too.

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
  • Thanks. I'm running R2010a on OSX, and the "Remove Previous Word" action doesn't exist. I'll have to wait for a departmental upgrade, but when it happens I'll know that I'll have this additional functionality. – Bill Cheatham Nov 03 '10 at 13:32
  • @Bill Cheatham: I can confirm that it's supported on OSX R2010b. – Jonas Nov 03 '10 at 14:01
  • Thanks guys. It just seems such an obvious, easy function to implement — I'm shocked it's taken so long! – Bill Cheatham Nov 03 '10 at 16:33
  • @Bill Cheatham: It's only in the last 2-3 releases that they've started putting some serious work into the editor after a lull during a few releases. – Jonas Nov 03 '10 at 18:52