To define the input aliases for your specific notebook, you need to append them to the default ones. So code like
SetOptions[EvaluationNotebook[],
InputAliases -> Join[InputAliases/.Options[EvaluationNotebook[], InputAliases],
{"tf" -> TableForm, "fi" -> FactorInteger, "re" -> RegularExpression}]]
will do the trick. (Although, this will not overwrite existing aliases of the same name. So you have to be more careful if need to redefine an existing alias.)
To add these aliases to all notebooks, you can:
- use the above code on the
$FrontEnd
object (instead of a Notebook object).
- use the
Option Inspector (Global Preferences) > Editing Options > InputAliases
and use the interface provided.
(This can also be used to change the aliases for any open notebook by selecting it from the dropdown menu.)
- or you can follow Mike's solution and add them to your default stylesheet.
The first two options will add the definitions to the init.m
file which should be located at FileNameJoin[{$UserBaseDirectory, "FrontEnd", "init.m"}]
.
For example, my "init.m"
file contains the non-standard input alias "l=" -> \[LongEqual]
, since I typeset quite a bit of maths.
Also, if you don't want your input alias to expand the "tf"
out to the full TableForm
, then maybe you could use something like
"tf" -> InterpretationBox[StyleBox["tf", FontSlant -> Italic,
FontColor -> GrayLevel[0.5], Selectable -> False], TableForm]
This keeps the compactness of your original definitions, but does not require the introduction of new symbols to your global context (or a new context). It looks like

To turn the tf
into TableForm
just select it and press Ctrl-Shift-I
, i.e., convert it to InputForm
.