[TxMt] Re: insert a column of numbers

Kai Brust kai.brust at gmail.com
Tue Oct 8 10:45:40 UTC 2013


On 08.10.2013, at 12:21, Ross Ahmed <rossahmed at googlemail.com> wrote:

> Is there perhaps a regex or other automation that could be used? I’m aware that it is possible to insert line numbers but this will only be useful if the 10 lines of code happen to be on lines 1-10.

Highlight / select the lines you want to number, choose Text->Filter Trough Command. Use “nl” as command, “Replace Input” as result. Now only your selected lines are numbered, regardless of their position in the file.

From there you can simply use multiple carrets to cut and paste the numbers to the two positions per line you want them to be with a couple of keystrokes.


More information about the textmate mailing list