New notebook editor (Experimental)

Databricks is moving the editor used in the Databricks notebook to Monaco, the open source component that powers VS Code. This page describes some of the functionality available with the new editor.

Enable the new editor

To enable the new editor:

  1. Click your username at the top right of the workspace and select User Settings from the drop down.

  2. Click the Notebook Settings tab.

  3. Check the box next to Turn on the new notebook editor.

Autocomplete (IntelliSense support)

When the notebook is connected to a cluster, autocomplete suggestions powered by VS Code IntelliSense automatically appear you type in a cell. Use the up and down arrow keys or your mouse to select a suggestion, and press Tab or Enter to insert the selection into the cell.

how to display code suggestions

Variable inspection

To display information about a variable defined in a notebook, hover your cursor over the variable name.

how to inspect a variable

Code folding

Code folding lets you temporarily hide sections of code. This can be helpful when working with long code blocks because it lets you focus on specific sections of code you are working on.

To hide code, place your cursor at the far left of a cell. Downward-pointing arrows appear at logical points where you can hide a section of code. Click the arrow to hide a code section. Click the arrow again (now pointing to the right) to show the code.

how to fold code

For more details, including keyboard shortcuts, see the VS Code documentation.

Multicursor support

You can create multiple cursors to make simultaneous edits easier, as shown in the video:

how to use multiple cursors

To create multiple cursors in a cell:

  • On macOS, hold down the Option key and click in each location to add a cursor.

  • On Windows, hold down the Alt key and click in each location to add a cursor.

To create multiple cursors that are vertically aligned:

  • On macOS, use the keyboard shortcut Option+Command+ up or down arrow key.

  • On Windows, use the keyboard shortcut Shift+Alt+ up or down arrow key.

Column (box) selection

To select multiple items in a column, click at the upper left of the area you want to capture. Then:

  • On macOS, press Shift + Option and drag to the lower right to capture one or more columns.

  • On Windows, press Shift + Alt and drag to the lower right to capture one or more columns.

how to select columns

Bracket matching

When you click near a parenthesis, square bracket, or curly brace, the editor highlights that character and its matching bracket.

show the corresponding bracket

Side-by-side diff in version history

When you display previous notebook versions, the editor displays side-by-side diffs with color highlighting.

show the code diffs