Page 1 of 1

How to highlight a sequence of line nos eg 8. 16, 24, 32...?

Posted: Tue Feb 12, 2008 6:03 am
by drquek
How do I highlight a sequence of line numbers automatically? Example: line numbers which are multiples of 8 ie, 8, 16, 24, 32, 40 etc...

Posted: Tue Apr 29, 2008 4:46 am
by HerNameWasTextPad
You might do something like this:

(1) Open the appropriate file, if it's not already open
(2) Turn the file's word wrap off, if it's not already off, using Ctrl+Q, W
(3) Ctrl+Shift+F2 to clear all bookmarks, if the file is not already clear of bookmarks
(4) Ctrl+Home to get the cursor to the top of the file, if it's not already at the top
(5) DownArrow 7 times to move the cursor to line 8
(6) Ctrl+F2 to toggle a bookmark at line 8
(7) Ctrl+F7, DownArrow to select the appropriate macro, Tab, E, Enter

. . . and you're done.

Of course, you'll first have to record the "appropriate macro." (You knew there was a catch, right?)

Here's how:

(1) Open the appropriate file, if it's not already open
(2) Turn the file's word wrap off, if it's not already off, using Ctrl+Q, W
(3) Ctrl+Shift+F2 to clear all bookmarks, if the file is not already clear of bookmarks
(4) Position the cursor at line 8
(5) Macros -> Record
(6) DownArrow 8 times to move the cursor to line 16
(7) Ctrl+F2 to toggle a bookmark at line 16
(8) Macros -> Stop Recording
(9) Save the macro using the Display name "BookmarksOnThe8s" (or something equally as satisfying, without the quotes)

If you REALLY want a run for your money, record one macro that moves the cursor 8 times, and another macro that both moves the cursor 7 times AND calls the one that moves the cursor 8 times. We might call this one "BOnThe8sStarter"; it should include steps (3) and (4) from those at the very top of this post. Get it? That would allow a fuller automation, so that you could process one file after another, by executing a single macro for each file.

If, however, you need to open n files, and would like to execute just one macro to process all n files at once, let me know, so that I can add to this a few more pieces of necessary information.

Remember that you must ensure that the word wrap is off, for any file that is to be processed, BEFORE RUNNING THE MACRO, in order for the screen's "lines" to match the cursor's counted movements.

N.B: The above was not tested; it is presented mainly to set forth ideas.