Skip to content

Add a command-mode shortcut to create a SQL cell below #10688

Description

@ababino

Description

Marimo command mode supports Esc, then b to create a new Python cell below the focused cell.
Creating a SQL cell requires an additional conversion step:

  1. Esc
  2. b
  3. Cmd/Ctrl + Shift + L

It would be useful to have a command-mode shortcut such as Esc, then q that directly creates and focuses a new SQL cell below the current cell.

Hex supports this interaction pattern: in command mode, q creates a SQL cell. Its keyboard-shortcut documentation describes command mode and notes that its Add Cell menu exposes shortcuts for creating specific cell types.

Suggested solution

Add a configurable action such as command.createSQLCellAfter, with q as its default command-mode binding.

Expected behavior:

  • Press Esc to enter command mode.
  • Press q.
  • Create a new SQL cell immediately below the selected cell.
  • Focus the new SQL editor.
  • Do not execute the currently selected cell.
  • Continue using the existing default SQL engine and output settings.
  • Expose the action in the keyboard-shortcut settings so users can remap it.
    The existing b shortcut should continue creating a regular Python cell.

Relationship to #6790

This is related to #6790, which proposes that Shift+Enter on a SQL cell should create another SQL cell.

A dedicated command-mode shortcut may be a better approach because it is explicit and does not change the existing semantics of Shift+Enter:

  • It separates cell creation from cell execution.
  • It works regardless of the current cell’s type.
  • Users can deliberately choose between a Python cell with b and a SQL cell with q.
  • It avoids implicitly deriving the new cell type from the preceding cell.
  • It does not affect users who expect newly created cells to default to Python.

The two proposals could coexist, but the command-mode shortcut provides the workflow without changing existing behavior.

Are you willing to submit a PR? (You must receive approval from the team before submitting a PR.)

  • Yes

Alternatives

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions