Function Repository Resource:


Source Notebook

Add a way to interactively input ResourceFunction symbols inline

Contributed by: Lukas Lang


permanently adds an interactive input for ResourceFunction symbols as input alias rfi.


installs the interactive input as input alias alias.


permanently adds the interactive input as a menu item with a hotkey.


permanently adds the interactive input with the specified hotkey.


removes any permanently installed changes.

Details and Options

The ResourceFunction input field added by ResourceFunction["ResourceFunctionInput"][] allows for inline creation of a ResourceFunction[] symbol.
Typing into the input field brings up a list of all available ResourceFunction names as known by the system.
If an unknown ResourceFunction is entered, a raw ResourceFunction["name"] expression is inserted.
The completion menu displayed by the input field can be navigated using the arrow keys. The selected function can be selected using either the key or the key.
The icon of the input field is colored blue to indicate that the input has not yet been confirmed.
ResourceFunction["ResourceFunctionInput"]["InstallAlias",] and ResourceFunction["ResourceFunctionInput"]["InstallMenuItem",] effectively install a paclet named "ResourceFunctionInput".
The alias or menu item can be removed again by using ResourceFunction["ResourceFunctionInput"]["Remove"] or by uninstalling the "ResourceFunctionInput" paclet manually.
Only the alias or the menu item can be installed at any given time, and installing one removes the other.
The default keyboard shortcut for the menu item is on Windows/Linux, and on macOS.
In ResourceFunction["ResourceFunctionInput"]["InstallMenuItem",MenuKey[]], the MenuKey[] expression can be anything supported by the system menu configuration file.
Typical settings for the menu item hotkey are of the form MenuKey["letter",Modifiers{mod1,}], where the modi are one of "Shift", "Control", "Command" and "Option".
Since the ResourceFunction subsystem needs to be loaded for the completion list to be available, the first use might be slow to load. In those cases, a loading icon is displayed until everything is initialized.
ResourceFunction["ResourceFunctionInput"]["AddAlias",] and ResourceFunction["ResourceFunctionInput"]["AddMenuItem",] can be used to add the alias or menu item to the current front end session only.
ResourceFunction["ResourceFunctionInput"][] returns the interactive ResourceFunction symbol input without adding any aliases or menu items.
ResourceFunction["ResourceFunctionInput"] requires Mathematica 12.0 or newer.


Basic Examples (3) 

Install the input as an input alias:


Insert a ResourceFunction input field by typing rfi:

Enter the name of a ResourceFunction:

Confirm the input by pressing the or key, or by clicking the name in the completion drop-down menu:

Install the input field as a menu item instead:


Insert an input field via Insert > ResourceFunction Input:

Use the keyboard shortcut ( on macOS) to insert the input field:

Remove the keyboard shortcut/alias (only effective after restarting Mathematica):


Scope (2) 

Create a one-off ResourceFunction input:


Add the alias rfiinput to the current front end session:

ResourceFunction["ResourceFunctionInput"]["AddAlias", "rfinput"]

Insert a ResourceFunction input field by typing rfinput into an input cell:


Lukas Lang

Version History

  • 3.0.0 – 21 December 2020
  • 2.0.0 – 02 December 2020
  • 1.0.0 – 20 November 2020

Source Metadata

Related Resources

Author Notes

Changes from version 1.1.0 to 1.2.0:

Fixed highlighting of currently selected function name not working in version 12.2.
The installed paclet now requires Mathematica 12.0 or newer.
Fixed "AddMenuItem" action not working as expected.

Changes from version 1.0.0 to 1.1.0:

Made changes to ensure that the menu item is more reliably added when restarting Mathematica.

License Information