Skip to content

✨ Multiple Cursors #30

Closed
Closed
@Jeehut

Description

@Jeehut

Problem:
Sometimes, you have multiple variables or a collection and you want to edit all occurrences at the same time.

Solution:
Other code editors like Atom and even Xcode have added multiple-cursor support to conveniently edit multiple places at once, this can save lots of time. We should add a similar feature here, too. Part of supporting multiple cursors, it's also important that this feature is accompanied by ways to create multiple cursors. I suggest the following two ways:

  1. A shortcut that select other occurrences of the currently selected text within the same file (creating multiple cursors with selection). In Atom that's Cmd+D, in Xcode it's Cmd+Alt+E. I suggest that this comparison is case-sensitive.
  2. A keyboard-command to explicitly specify the places with the mouse cursor where the multiple text cursors should be created. In Xcode, this happens by holding the Alt key and either pressing manually into multiple places or by simply clicking the mouse and dragging it down to create multiple cursors at the same column on multiple lines.
Screen.Recording.2022-06-01.at.4.53.30.PM.mov

Alternatives considered:
Making the search with the shortcut case-insensitive (like Xcode does by default, it changes based on your last search settingS) makes this feature error prone when there's for example a class named String and 5 variables named string and I want to just edit the variables, I might accidentally also select the class.

Atom also supports a shortcut for finding all occurrences of the currently selected text in the file and create multiple cursors for all. This seems to be an extra feature that could be added later on. In the meantime, just holding the last key of the shortcut should select all entries within the same file relatively quickly as an alternative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🏁 Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions