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

  • 2.2.0
  • github.​com
  • github.​com
  • 11 months ago
  • 17 minutes ago
  • 13 years ago

Installs

  • Total 6K
  • Win 3K
  • Mac 1K
  • Linux 973
Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6
Windows 0 1 1 2 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 0 2 0 0 0 0 0 2 0 1 0 0 0 0
Mac 0 1 2 0 1 0 0 1 1 0 0 0 0 0 0 0 2 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 2 0 1 2
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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

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

  1. Using Package Control, install “DuplicateSelections”

Or:

  1. Open the Sublime Text Packages folder

    • OS X: ~/Library/Application Support/Sublime Text 3/Packages/
    • Windows: %APPDATA%/Sublime Text 3/Packages/
    • Linux: ~/.Sublime Text 3/Packages/ or ~/.config/sublime-text-3/Packages
  2. clone this repo

  3. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys)

Commands

duplicate_selections: See description above