Duplicate Lines
A modified version of the duplicate_line command for Sublime Text 2/3
Details
Installs
- Total 17K
- Win 8K
- Mac 6K
- Linux 2K
Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 0 | 0 | 0 | 2 | 2 | 1 | 2 | 1 | 4 | 0 | 2 | 1 | 2 | 2 | 3 | 1 | 2 | 1 | 2 | 0 | 1 | 1 | 1 | 1 | 1 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 4 | 0 | 2 | 2 | 0 | 1 | 0 | 0 | 2 | 1 | 1 | 0 |
Mac | 1 | 3 | 0 | 0 | 1 | 2 | 3 | 2 | 2 | 0 | 0 | 3 | 2 | 2 | 1 | 2 | 0 | 1 | 1 | 1 | 0 | 0 | 2 | 0 | 1 | 3 | 1 | 0 | 3 | 1 | 0 | 0 | 1 | 2 | 2 | 1 | 2 | 0 | 0 | 5 | 2 | 2 | 0 | 1 | 0 |
Linux | 1 | 2 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 2 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Better Duplicate Lines command for Sublime Text
A modified version of the duplicate_line command for Sublime Text that allows you to duplicate multiple lines of text without worrying about the position of the cursor. If you use your keyboard to highlight the text you want to duplicate, this modified command is for you. (Although, I think it's better even if you use a mouse to select text too.)
I wasn't happy with the way the duplicate_line command was working in Sublime Text, so I made a modified version. This modified command will still duplicate a single line the same way. The behavior is slightly different, however, when duplicating multiple lines.
Rather than having to fully select the area to duplicate, you can now simply run your cursor selection over multiple lines, and this command will duplicate any lines that are even a part of the selection. So, if your cursor is in the middle of the line, it will still duplicate from the hard beginning of the first line in the selection to the end of the last line selected, and it will duplicate all of it directly below your selection. (The original command literally duplicates from wherever your cursor is positioned to where it ends, which created extra keystrokes for me.) This also means your selection no longer has to include empty space from the previous line to your selection in order to duplicate to a new line. It's a small difference, but if you prefer Eclipse-like behavior with this command, you'll like this.
Get it with the Sublime Text package manager
Note: If you've previously installed my command using the method above, it's a good idea to undo that before installing via package manager. (Remove the duplicate_lines.py file from the directory in the without package manager directions below, and remove the key command from your Key Bindings - User file.
- Launch Sublime Text Package manager
- Search for Duplicate Lines, and choose it to install it as a package.
Without Package Manager
- Download the repo
- In Sublime Text 2 or 3, go to Preferences -> Browse Packages
- Extract the contents to the folder
- Edit your Key Bindings - User file (and bind whatever command to it that you want)
{ "keys": ["super+shift+d"], "command": "duplicate_lines" }
{ "keys": ["super+shift+u"], "command": "duplicate_lines", "args": { "up": true } }
Enjoy.