Skip to content
← Back to Community
Copying code with line numbers
Profile icon
JoeEnglish

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

Voters
Profile icon
techhypedtm
Profile icon
KeroroJH
Profile icon
EmelyBeltre
Profile icon
JoeEnglish
Comments
hotnewtop
Profile icon
mwilki7

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.

Profile icon
Zavexeon

Try making a numbered list and then copying and pasting?