# Live code templates

GROUPS:

## Background

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.

So I created a little stylesheet, for 11+ (v10 on todo list) and in a beta stage at the moment.

Should work on Win/MacOs. Do not use on pre V11 as it may crash the FE.

https://github.com/kubaPod/DevTools

I case you are interested and/or have any ideas about this / similar features, let me know here or create an Issue in GitHub.

Topic cross posted on Mathematica.stackexchange: https://mathematica.stackexchange.com/q/164653/5478

## Setup

   (*additional package I use to install github assets' paclets,
*)
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"] = FrontEndFileName[{"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. ## Example There is also a dark one based on a build-in ReversedColors.nb stylesheet: CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"
] = FrontEndFileName[{"DevTools", "DevPackageDark.nb"}]
`