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

Copy Cut and Paste Lines

by AlanLynn ST3

Copies and cuts partially selected lines as full lines.

Details

Installs

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

Readme

Source
raw.​githubusercontent.​com

Copy Cut and Paste Lines - Package for Sublime Text

The purpose of this package is to improve your coding efficiency.

It does that by replacing the default Copy, Cut, and Paste with new versions that treat partially selected lines of code as fully selected. This makes it easier to copy/cut/paste full lines of code. And because moving lines of codes is such a common operation, making it even a little easier has a big benefit.

In case you need to use the original versions of copy/cut/paste, they are bound to new shorctuts.
Original Copy: Ctrl+Alt+C Original Cut: Ctrl+Alt+X Original Paste: Ctrl+Alt+V
If you don't like these bindings, set your own in Key Bindings - User. (See section Rebinding Keys.)

Demonstration

Cutting and pasting lines:
Demonstration gif

Potential Downsides

  • There are some scenarios when you don't want to cut/copy/paste lines, for example using rectangular selection. In this case, use the rebound shortcuts listed above.
  • No entries are created in the paste history list.

How to Install

  1. Install Package Control if you do not already have it.
  2. In Sublime Text, open the Package Control command pallete. (Preferences → Package Control)
  3. Select “Install Package”.
  4. Search for Copy Cut and Paste Lines, and select it.

Rebinding Keys

If you don't like the default key bindings, paste the code below into Key Bindings - User and edit the keys to your liking.

// Key bindings for the "improved" copy, cut, paste, and duplicate commands:
{ "keys": ["ctrl+c"], "command": "ccpl_copy" },
{ "keys": ["ctrl+x"], "command": "ccpl_cut" },
{ "keys": ["ctrl+v"], "command": "ccpl_paste" },
{ "keys": ["ctrl+shift+d"], "command": "ccpl_duplicate" },
// Key bindings for the original copy, cut, paste, and duplicate commands:
{ "keys": ["ctrl+alt+c"], "command": "copy" },
{ "keys": ["ctrl+alt+x"], "command": "cut" },
{ "keys": ["ctrl+alt+v"], "command": "paste" },
{ "keys": [""], "command": "duplicate_lines" },