Should I remap keyboard shortcuts?

Hi,
I am new with MATLAB, but it has already saved me a lot of work by making programming simple.
I would just like to ask about the keyboard shortcuts. They are not the same standard as Windows or Linux. I now use Ubuntu and I got the following, for example: alt/w copy, ctr/y paste (requires long fingers ;)), ctr/shift/- undo.
I am an older guy and change is difficult ;) I sometimes lean too long on the alt/w and end up in the view panel.
So far everything I have seen about MATLAB has been well considered and well worked out. So the choice of shortcuts is no coincidence, I am sure.
Before I remap the keyboard shortcuts I would just like to ask if there will be any negative consequences if I remap to ctr/c, ctr/x, ctr/v, ctr/z etc
Thank you

 Accepted Answer

Stephen23
Stephen23 on 5 Aug 2016
Edited: Stephen23 on 5 Aug 2016
"if there will be any negative consequences"
None.
MATLAB provides the option to change the shortcuts:
This option exists, so why not use it?

10 Comments

OK, I'll do that. My question is also a little bit out of curiosity. I honestly think they seem to have worked through the software well. I am therefore interested in how they could have come to this choice of shortcuts.
I guess, like most things in MATLAB (or most any other programming language), the origins are lost in the mists of time... Perhaps Fortran used something similar?
Matlab certainly has lots of nice features and is easy to pick up and yes, part of it is well designed.
However, as you master matlab, you will come across numerous features that you feel are ill-designed. See this thread for example.
"yank" (y) is like copy in vi and emacs, but still not paste. I have not worked full time with programming, but I used punch cards in shoe boxes in the 70's and DEC/KED. The shortcuts here don't ring a bell. alt/w is "close file" nowadays, isn't it.
Well if this is my question after one month use, the software is probably ok. But like you write, if I get deeper into it, I may find many things I could comment on.
John, by default MATLAB offers two or three different sets of keyboard shortcuts: Windows Default Set, Emacs Default Set, and [if I remember the name correctly, if you're on the Mac] Mac Default Set. But nothing limits you to using just one of those three sets; in the Shortcuts item in the Keyboard section of the Preferences for MATLAB (see the Environment section of the Home tab in the toolstrip) you can modify the shortcuts, save your preferred set to a file to be copied to another machine or to store as a backup, compare your set to another, etc.
Personally I use Windows Default Set even on Linux because I'm more familiar with Windows than with Emacs. But if necessary I can temporarily switch over to Emacs to check something.
I used that switching capability to check the Windows and Emacs sets. The combination Alt+W is not mapped to anything in the Windows set but is mapped to Copy in the Emacs set. You may be thinking of Ctrl+W, which is mapped to Close on Windows and Cut on Emacs. [The combination Ctrl+X,Ctrl+W is also mapped to Save As in Emacs.]
John Lof
John Lof on 5 Aug 2016
Edited: John Lof on 6 Aug 2016
Ahh, I see. I had missed that.
Thank you Steven. I use Ubuntu-Linux and MATLAB had given me the Emacs shortcuts. I use MATLAB 2016 and the environments come up under preferences, keyboard shortcuts. I just made one switch in the drop down menu and now all is as I am used to.
I think most Ubuntu users are used to these Windows/Linux-graphical shortcuts and for Linux-install MATLAB should maybe choose Windows shortcuts instead??
Should you write an answer about this "trap" for us beginners (at least it's a trap if we don't read the menus carefully \*ashamed\* ;) ? Otherwise I can write it.
Edit, Aug 6: I skip writing another answer. I now see it is all in the link that Stephen gave in his answer.
As someone who has been using Unix since the early 1980's: the Emacs key combinations predate the Windows key combinations, and the Emacs key combinations are what has been driving command line editing in Unix since fairly early on in ksh -- before the end of the 1980's for sure.
It could be that Ubuntu tends to appeal to people crossing over from Windows, but for Linux in general, the Emacs set is arguably the better default.
Haha, let's rekindle the editor wars ;) I fought for vi. (Just joking of course.) I think vi-mode in Emacs is called "devilish mode" :)
Seriously - Thanks for the help finding the correct drop down menu.
I once used the now defunct Codewright programmers editor, and I used a keymap based on the even older and "defuncter" Brief programmers editor. I really wish MATLAB would use a programmers type of keymap instead of Windows. For example to copy the line of code where you cursor is, simply hit + on the extended keypad. To cut hit the minus sign. So easy! None of this complicated stuff like trying to accurately position your arrow on the left side of the line and clicking, and then contorting your fingers to press two keys. One keystroke and boom! it's done. No mouse moving or multiple keys. To paste, simply hit the insert key -- so much easier than control-v.
To record a macro, type F7 then do all your keystrokes and hit F7 again to end it. Then to replay all those keystrokes from the current cursor location, simply hit F8. As of now, there is no macro and record capability in MATLAB at all that I'm aware of. Let me know if I'm wrong, but it needs to be single keystroke to be convenient, not drilling down into menus like Excel does it.
And to find, hit F5. To search and replace hit F6. Much easier than that two fingered control F and control H.
John Lof
John Lof on 28 Aug 2016
Edited: John Lof on 28 Aug 2016
I agree Image Analyst. Macros can really speed up, but they seem not to be high priority. In Windows I finally found Crimson Editor that had good macros. Notepad++ still has bugs.
Right now I am struggling with Linux default editor gedit that seems unwilling to even accept plug-ins for macros!
I think the Linux developers don't care to improve anything that can be done with (admittedly flawless) terminal programs like e.g. vi and emacs. (I'm back in vi now, which I haven't used seriously for more than 20 years :) )

Sign in to comment.

More Answers (0)

Categories

Find more on Scripts in Help Center and File Exchange

Asked:

on 5 Aug 2016

Edited:

on 28 Aug 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!