Sublime Forum

Multi cursor sequential insertion package

#1

Multi cursor sequential insertion package

I saw last year this package while searching for cool packages, but did not think it was useful until I get to need it a few times on the last few days.

Now I completely forgot how was that package name, or what I was using as search term to find it out. I tried a few but did not get much. I am looking the package which can do this:

  1. I have several cursors like this:
Abc |
Abc |
Abc |
Abc |
  1. Then I call for the package command and I got only the first cursor.
Abc |
Abc 
Abc 
Abc 
  1. Then I type something like a:
Abc a|
Abc 
Abc 
Abc 
  1. Then each time I press enter, the cursor follow to the next cursor automatically, until all my initial cursors/carets being covered/processed.
Abc a
Abc |
Abc 
Abc 

–>

Abc a
Abc b|
Abc 
Abc 

–>

Abc a
Abc b
Abc |
Abc 

–>

Abc a
Abc b
Abc c|
Abc 

–>

Abc a
Abc b
Abc c
Abc d|
0 Likes

#2

This is part of MultiEditUtils (with tab instead of enter).

2 Likes

#3

One way of doing that is PowerCursors.

With an added key binding like the following, it would work the way you mentioned above:

{ "keys": ["enter"], "command": "power_cursor_select", "args": { "forward": true },
  "context": [ { "key": "in_cursor_transition" } ]
},
2 Likes

#4

Thanks, both are awesome packages, I am installing both.

Though, PowerCursor is going good with the enter feature. This is life saving:

1 Like

#5

Just for the completeness: You can also add a keybinding for MultiEditUtils:

    {
        "keys": ["enter"], "command": "selection_fields",
        "args": {"mode": "cycle"},
        "context":
        [
            { "key": "is_selection_field" }
        ]
    },
```
2 Likes

#6

In completion to @OdatNurd answer, I just added the ctrl+enter to jump back to the last cursor.

{
    "keys": ["enter"], "command": "power_cursor_select", "args": { "forward": true },
            "context": [ { "key": "in_cursor_transition" } ]
},
{
    "keys": ["ctrl+enter"], "command": "power_cursor_select", "args": { "forward": false },
            "context": [ { "key": "in_cursor_transition" } ]
},
0 Likes