Formatting code with line numbers

Solution 1:

When the code is in Notepad++, you can use TextFX->TextFX Tools->Insert line numbers to put line numbers in front of all of the necessary lines. Then when you copy/paste, the line numbers will be there.

Solution 2:

To avoid having to remove unnecessary leading zeros, you can use the Notepad++ column editor (Edit -> Column Editor or Alt+C) after you've done a column select at the first column. You'll get a window like this:

Column Editor Window

I like to use leading zeros, but you can just as well leave them out. Trailing spaces will be added instead. You will have to indent your code one extra time (or use a leading space), as this method won't automatically add one for you.