From: Ronald Fischer Date: 2007-09-13T18:42:15+09:00 Subject: Re: copy/paste line numbers with code > I'm writing up my project report and want to include line numbers with > the code that i paste into my word doc writeup. Does anyone know of a > ruby editor for windows that will allow this? Not directly, but here are a few ideas: - jEdit (http://www.jedit.org/) is a programmable editor (programmable in BeanShell-Java and Python), and there are many extensions available. For example http://taat.pl/en/jedit/#macros lists a macro Lines_to_numbered.bsh which is supposed (I haven't tried it) to write line numbers in front of each line. You call the macro, copy the buffer, and undo the changes. Actually, if you don't mind diving into BeanShell programming, you could write your own macro doing this. - Notepad++ is similar in this respect. Here you can use the plugin "TextFX Tools", which has a command "number lines", which puts line numbers in front of the selected text, though in just one standard format (with leading zeroes), and I don't know how easy it is to change this. Again, you can copy the numbered file to the clipboard and remove the line numbers with Control-Z afterwards. You can download it from http://notepad-plus.sourceforge.net/de/site.htm - You could put the line numbering process outside of the editor, either by writing a trivial Ruby program which creates a file with numbers out of a text file, or using some of the utilities which are already available (I use, for example, Cygwin, which has the nl command for numbering the lines). Many editors allow running an external program on the buffer - examples are (again) jEdit, but also the vi family and, AFIK, Scite too. HTH Ronald -- Ronald Fischer Phone: +49-89-452133-162