It is very handy to have shortcuts for frequently used glyphs, e.g. [[
, ]]
, <|
, |>
, and ->
. I know already that we can do this by modifying KeyEventTranslations.tr located in
FileNameJoin[{
$InstallationDirectory,
"SystemFiles",
"FrontEnd",
"TextResources",
"Macintosh"
}]
Working with US keyboard layout, I added the following to the file:
...
Item[KeyEvent[">", Modifiers -> {Control}],
FrontEndExecute[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"\[AliasDelimiter]",After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"->",After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"\[AliasDelimiter]",After]
}]
],
Item[KeyEvent["[", Modifiers -> {Shift,Control}],
FrontEndExecute[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"\[AliasDelimiter]",After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"<|",After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"\[AliasDelimiter]",After]
}]
],
Item[KeyEvent["]", Modifiers -> {Shift,Control}],
FrontEndExecute[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"\[AliasDelimiter]",After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"|>",After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],"\[AliasDelimiter]",After]
}]
],
...
This worked splendidly for the last two or three major releases of Mathematica. But now in version 12, precisely what Szabolcs anticipated here happened to me: Seemingly, new shortcuts
- Shift+Ctrl+.,
- Shift+Ctrl+[, and
- Shift+Ctrl+]
have been added, ruining my established workflow. Actually, I am not sure that these shortcuts are new, but starting with version 12, my former approach does work anymore. At least Shift+Ctrl+. seems to be remapped to something related to notebook cell selection. Shift+Ctrl+,, another shortcut that I remapped and that I use often, is already present in version 11.3 -- but the remapping worked well. So maybe the order in which the shortcuts are loaded when the FrontEnd starts has changed?
I don't use these shortcuts in the new built-in way; I'd rather prefer to overwrite them with my old settings because I #!@&ing don't want to relearn typing every time a new version is realeased!
I also found the "Shortcuts`"
package by Rolf Mertig, but as Rolf pointed out, it does not seem to work anymore (I have to admit that I have not tried it yet).
Has anybody found a robust, future-proof solution for this?
MenuSetup.tr
? $\endgroup$MenuSetup.tr
, I was able to find the lineMenuItem["Extend Selection", "ExpandSelection", MenuKey[".", Modifiers->{"Control"}]],
but that should not modify <kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>.</kbd> or should it? Neither did I find any further remappings of ">" or "." that would fit the pattern... $\endgroup$tr
-files... $\endgroup$