Add "Expand selection" shortcut to marimo

Open
#10,953 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Look at the marimo editor's selection handling, likely in frontend code for the editor component. Understand how the editor currently parses Python expressions and identifies syntactic boundaries (brackets, parentheses, quotes). Start by implementing expansion to nearest enclosing brackets as a fallback, then consider true sub-expression detection. Test the feature in the editor UI.

Written by the indexing model from the issue text.

Description

enhancement needs discussion
Description

"Expand selection" is a great feature in Mathematica which has been adopted in VS Code as well. It is extremely intuitive and prevents many errors of type "cut/copied one too many/one too little brackets". Here is the demonstration in Mathematica (link), shortcut Ctrl+.:

Image

and VS Code (link), shortcut Shift+Alt+Right:

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

If the full implementation (highlighting true sub-expressions) is for some reason not possible, would be nice to at least be able to at least expand the selection to the nearest enclosing brackets/quotations/parentheses.

Additional context

No response

Dominant language
Python
Stars
22.9k
Forks
1.3k
Avg merge
1d 10h
Merged PRs (30d)
380

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from marimo-team/marimo

All issues in marimo-team/marimo

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.