ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Duplicate​Selections

If you have an equal number of empty selections (cursors) and selections, this command will place each selection at the corresponding cursor location.

Details

Installs

  • Total 6K
  • Win 4K
  • Mac 1K
  • Linux 980
Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 1 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0

Readme

Source
raw.​githubusercontent.​com

DuplicateSelections

I wrote and use this plugin as an alternative to copy and pasting.

First, you can use this command to duplicate the current line (or lines).

Another common use case is when you need to copy some small bit of text, like a variable or method name.

Select the text to copy, then cmd+click to place an empty cursor, then run this command to insert the selected text at the cursor position.

This can be extended to multiple selections: if you have an equal number of selections and cursors, this command will place each selection at the corresponding cursor location.

Or, you can select some text and place multiple empty cursors, and the selection will be inserted at all the cursor locations.

Example:

Example.mp4

Installation

Using Package Control, install “DuplicateSelections” or clone this repo in your packages folder.

I recommended you add key bindings for the commands. I've included my preferred bindings below. Copy them to your key bindings file (⌘⇧,).

Commands

duplicate_selections: See description above

Key Bindings

Copy these to your user key bindings file.

{ "keys": ["ctrl+d"], "command": "duplicate_selections" },