Message Boards Message Boards

The Most Convenient Keyboard Shortcuts Ever

Posted 4 years ago
POSTED BY: Michael Sollami
15 Replies

All my keyboard shortcuts have stopped working with version 12.1. Oh well.

POSTED BY: Gianluca Gorni

@kuba Cool, thanks for the link I'll check it out. Do you know if there's any overview/list of the ones Rolf supports? Also, do they work on linux and windows as well as macos?

POSTED BY: Michael Sollami

There is an image from Shortcuts documentation attached to the SE post I linked. And it suggests they work on Linux and macOS.

p.s. you may also be interested in: https://mathematica.stackexchange.com/questions/164653/live-code-templates

POSTED BY: Kuba Podkalicki

FYI, check Shortcuts`:

https://mathematica.stackexchange.com/a/85824/5478

Get@"http://www.mertig.com/shortcuts.m"

It does not support [_] but [[_]] + many more.

POSTED BY: Kuba Podkalicki

I have set the BBEdit text editor so that Cmd-[, Cmd-{, Cmd-" Cmd-( give [] {} "" () pairs, enclosing any selected text, and they work fine.

The KeyEventTranslations that I reported above were meant to reproduce the same behaviours, but among them only Cmd-" and Cmd-( perform as desired on my system. I remember that back during Mathematica version 8 (or 7, I am not sure), when I first heard of these tricks, they were working correctly.

I wonder if it is an idiosincrasy of my system.

POSTED BY: Gianluca Gorni

Gianluca,

Please clarify your post. Are you saying that it now works in Mathematica or are you saying that you can use Cmd-[ as a shortcut in another program (but not in Mathematica)?

Regards

Neil

POSTED BY: Neil Singer

These shortcuts would only in Mathematica (if you configure them as above).

POSTED BY: Michael Sollami

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor! Thank you, keep it coming!

POSTED BY: Moderation Team

It appears that Cmd-[ will not work on my mac either, but if I use Mike's shortcut and change it to Control, it works. I suspect the OS is using CMD-[ for something else. For example, in System Preferences, CMD-[ is back in the view menu. Maybe that definition is global so Mathematica can't use it.

Regards,

Neil

POSTED BY: Neil Singer

I configured the very same keyboard shortcuts Cmd-[ etc in the BBEdit text editor, and they work fine in there.

POSTED BY: Gianluca Gorni
Posted 4 years ago

Cleaner to place the modified KeyEventTranslations.tr in

FileNameJoin[{$UserBaseDirectory, "SystemFiles/FrontEnd/TextResources/Macintosh"}]

rather than changing the installed application contents.

POSTED BY: Rohit Namjoshi

Hi Rohit, you are correct, but the reason I'm using the system application folder is that I have a few different copies of mma, and I've encountered issues when configuring them from a common $UserBaseDirectory.

POSTED BY: Michael Sollami
POSTED BY: Gianluca Gorni
Posted 4 years ago

Hi Gianluca,

I use Control rather than Command on my Mac e.g.

Item[KeyEvent["[",Modifiers->{Control}],
    FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
    "[\[SelectionPlaceholder]]"],FrontEndToken["MovePreviousPlaceHolder"]}]],

Item[KeyEvent["]",Modifiers->{Control}],
    FrontEndExecute[{FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
    "\[LeftDoubleBracket]\[SelectionPlaceholder]\[RightDoubleBracket]"],
    FrontEndToken["MovePreviousPlaceHolder"],FrontEndToken["MovePreviousPlaceHolder"]}]],
POSTED BY: Rohit Namjoshi

Hi Gianluca, that's too bad! I'm using version 12.0, but I'll try your shortcuts out later and let you know if they work for me.

POSTED BY: Michael Sollami
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract