0

When editing code with Sublime Text, I often use multiple cursors to put the same text in multiple locations. Usually each location will start with some common prefix, and end with something unique to each occurrence. For example, I'll have this code with a cursor at the end of each line:

<div class="form_
<div class="form_
<div class="form_

Is there a plugin or some other way to switch to single cursor mode with tab-stops for each cursor? Similar to the way snippet placeholders work so that I can press tab to move to the next cursor position?

If the above is possible, is it also possible to switch back to multiple cursors after editing each line individually?

1 Answer 1

1

This is part of the package MultiEditUtils and called "selection fields". You can just install the package and add the keybinding:

{ "keys": ["alt+d"], "command": "selection_fields" },

Afterwards just press alt+d and use tab (or again alt+d) to step through the selections. If you step behind the last one or press escape all selections will be restored.

1
  • Would +100 if I could. This is really good to know. Worth checking out the plugin's other features.
    – slhck
    Commented Jul 6, 2017 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .