(please consider it beta before it hits 1.0.0)
-
Dark theme for .m/.wl files
-
Customizable Code Templates (see below and SE: Live code templates)
-
Customizable Notebook Actions (see below and SE: custom un/comment)
-
via Wolfram Function Repository: GitHubInstall
ResourceFunction["GitHubInstall"]["kubapod", "devtools"]
-
Manual way
Go to 'releases' tab and download appropriate .paclet file.
Run
PacletInstall @ path/to/the.paclet
file -
via MPM
(*If you don't have MPM` yet*) Import["https://raw.githubusercontent.com/kubapod/mpm/master/install.m"] Needs @ "MPM`" MPM`MPMInstall["kubapod", "devtools"] (* now see 'Setup dark stylesheet with all features' section below*)
PacletUninstall /@ PacletFind["DevTools"];
DeleteDirectory[FileNameJoin[{$UserBaseDirectory, "ApplicationData", "DevTools"}],
DeleteContents -> True
];
In order to use the stylesheet as a default one for .m/.wl files, run:
CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"
] = FrontEnd`FileName[{"DevTools", "DevPackageDark.nb"}]
And if you don't like it:
CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"
] = "Package.nb"
Templates menu is available in DevPackageDark.nb stylesheet mentioned above. This stylesheet is not tested for regular notebooks yet but if you want to enable templates menu for any notebook you can run:
Needs @ "DevTools`";
CodeTemplatesEnable[];
Templates menu can be opened with Ctrl + 1 shortkey.
Custom code templates can be added via package toolbar / Templates&Actions / EditCodeTemplates item.
<| "Template" -> _String | _RowBox (*the only one which is reqiired*)
, "Label" -> _
, "ShortKey" -> _?(StringMatchQ[Character])
, "ExpandSelection" -> _boole:True
, "Preview" -> _ : None
|>
-
Template
_RowBox
: whatever PasteButton can handle it should too_String
: StringTemplate syntax with`sel`
as a placeholder for a selection data. This needs to be polished as it assumes the selection will be a single token, not a BoxForm.
-
Label, menu item label, is optional but for longer templates it is encouraged.
-
ShortKey, optional, with opened menu it will automatically launch associated template
-
ExpandSelection: whether to expand selection if nothing is selected
-
Preview should be automatically generated form "Template" (unless Template was used as a Label). You can use whatever you want as a preview though.
They are very similar to templates feature.
Actions menu is available in DevPackageDark.nb stylesheet mentioned above. This stylesheet is not tested for regular notebooks yet but if you want to enable actions menu for any notebook you can run:
Needs @ "DevTools`";
NotebookActionsEnable[]; (*NotebookActionsDisable[] to revert changes*)
Difference is that the menu with actions is invoked by Ctrl + , and an action item should look like this:
<| (*!!! DON'T FORGET ABOUT :> FOR THE ACTION !!! *)
"Label" -> _String,
"ShortKey" -> _String,
"Action" :> foo[]
|>