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 297
  • Win 183
  • OS X 51
  • Linux 63
Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31
Windows 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0
OS X 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 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 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

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" },