Copying code with line numbers
JoeEnglish (0)

Is there a way to copy code including line numbers? (I want to paste into Word)

You are viewing a single comment. View All
mwilki7 (193)

If you have AutoHotKey installed, run this script:
Copy paste the code in a text file first

line := 1
$F1::
while GetKeyState("F1", "P")
{ 
     Send {home}
     Send %line%
     Send {space}
     Send {down}
     line := line + 1
}

Make sure your cursor is at the beginning of the file and hold F1 until you reach the end of the file.