22
$\begingroup$

I enjoy coding in the FrontEnd (except it crashes and lookup across files does not exist), but I often miss 'hands on keyboard', customizable code templates.

E.g. I often forget to wrap an option name with quotes "_" or I'm starting a new function and would like to avoid retyping Attributes/Options Catch/Check etc.

I don't like palettes for something that I need to do quickly and frequently.

Is there a package to support my needs?

$\endgroup$
3
  • 5
    $\begingroup$ "I don't know which version you use, but Mathematica hasn't crashed on me since the late nineties." – Stephen Wolfram, 2015 $\endgroup$ Commented Feb 23, 2018 at 18:14
  • $\begingroup$ @CarlosChida Hilarious quote! Where did you find that? $\endgroup$
    – M.R.
    Commented Jan 16, 2019 at 4:48
  • 1
    $\begingroup$ @M.R. Not found: he said it to me in a face-to-face meeting in Champaign during the Wolfram Conference 2015 when I pointed out that Apple’s Retina Displays didn’t seem to be fully supported yet. $\endgroup$ Commented Jan 30, 2019 at 21:25

1 Answer 1

25
$\begingroup$

Revision history:

  • v0.8.0 (06-07-2018) VerificationTest template

    enter image description here

  • v0.7.0 (21-02-2018) V10.4 support

    As of v0.7.0 code templates should work in V10.4.


Yes, in a beta stage at the moment. Feedback appreciated.

Should work on Win/MacOs.

https://github.com/kubaPod/DevTools

Setup

   (*additional package I use to install github assets' paclets,
     you can download .paclet manually if you want 
    *)
Import["https://raw.githubusercontent.com/kubapod/mpm/master/install.m"]
Needs["MPM`"]  

   (*installing the package*)  
MPMInstall["kubapod", "devtools"]

  (*changing default .m stylesheet to a dev's stylesheet*)
CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"] = 
 FrontEnd`FileName[{"DevTools", "DevPackage.nb"}]


  (*test*)
FrontEndTokenExecute["NewPackage"]

How to:

  • Ctrl+1 to open a menu

  • navigate with arrows and hit enter/return or hit a shortkey like n / { / [

Customization

Once you setup a new stylesheet the package should have an additional toolbar with 'Edit code templates' button on the top right. Click on it and a user's templates file should open.

It is just a .m file with a header that should explain everything. It will be improved in future.

Showcase

enter image description here

There is also a dark one based on a build-in ReversedColors.nb stylesheet:

CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"
] = FrontEnd`FileName[{"DevTools", "DevPackageDark.nb"}]

enter image description here

Menu in V10.4

enter image description here

$\endgroup$
4
  • $\begingroup$ Oh Lordy this is way more than I though it was! Any clue how 12 likes it? $\endgroup$ Commented Jun 14, 2019 at 11:20
  • 1
    $\begingroup$ @CATrevillian I don't use it very often (I work more and more in Intellij) but so far I didn't face any problems related to v12 $\endgroup$
    – Kuba
    Commented Jun 14, 2019 at 11:30
  • 1
    $\begingroup$ This is going to be a game changer for me. I suck at “real programming” ie inserting error checking like the above example, add onto that I have bad hands too that like to smash every key but the right ones! $\endgroup$ Commented Jun 14, 2019 at 11:34
  • 1
    $\begingroup$ @CATrevillian I looking forward to hearing about your experience. $\endgroup$
    – Kuba
    Commented Jun 14, 2019 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.