Quantcast
Viewing all articles
Browse latest Browse all 7

Unity/MonoDevelop Add-In: Duplicate selected lines with a keystroke.

This is one of those things that you don’t know you need until you have it, and the one feature I’ve missed the most since my Eclipse/FlashBuilder days:
I wrote a little MonoDevelop Add-In that lets you duplicate the line you’re on (or multiple selected lines) by pressing Alt+Ctrl+Up to duplicate above or Alt+Ctrl+Down to duplicate below your current position. In combination with Alt+Up and Alt+Down (which move selected lines around), this comes in super handy for dealing with repetitive blocks of code (such as variable declarations).

You can download the plug-in here: http://www.philippseifried.com/files/MonoDevDuplicateSelection.zip

To install, close MonoDevelop and copy the DLL into the folder /Applications/Unity/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns on Mac, or [Unity install path]/Unity/MonoDevelop/AddIns on Windows. After starting MonoDevelop again, you can use the keyboard shortcuts, or access the functionality from the Edit menu.

Note that you will need to re-install the Add-In if you update Unity!

The Add-In is under MIT license, so feel free to use and redistribute it as you see fit. I’ve tested it on Windows and Mac (where I’ve been using it daily for a few weeks), but of course standard disclaimers apply: Use at your own risk!


Viewing all articles
Browse latest Browse all 7

Trending Articles