Trick to easily bookmark one or several range(s) of lines, in the current file
-
Hi, All,
If you need to bookmark one or more bunch(s) of consecutive lines, all at once, here is my trick :
-
First put any number of consecutive
#symbol(s) at the end of, both, the first and last lines to be bookmarked -
Repeat this action for any other range of lines, which needs bookmarking
-
Use the
Markdialog and search a specific regular expression
So, here is the road map, with a recent N++ release :
-
Put, for instance, the string
###at the end of a first line to be bookmarked -
Put an other string
###at the end of a last line to be bookmarked -
Repeat these two points above, for any range of lines, which needs bookmarking ( any number of
#symbols is valid ) -
Now, open the Mark dialog (
Edit > MArk...) I personally mapped theCtrl + Mto the Mark dialog ! -
SEARCH
#+$(?s).+?#+$ -
Tick the
Bookmark line,Purge for each searchandWrap aroundoptions -
Untick the
Backward directionoptions, if necessary -
Select the
Regular expressionsearch mode -
Click on the
Mark Allbutton
Voilà !
-
Now, untick the
Bookmark lineoption ( IMPORTANT ) -
Click on the
Clear all marks, again, to delete theredhighlighting => Only the bookmarks remain visible -
Eventually, you may remove all these
#symbols, at end of lines, with the simple regex S/R :
SEARCH
#+$REPLACE
Leave EMPTYBest Regards,
guy038
P.S. :
On reflection, I’d say that it would be nice if, after an
Edit > Begin/End Selectaction, aCtrl + F2would bookmark / unbookmark all the lines of that selection !Of course, in case of a normal selection, a
Ctrl + F2action would just bookmark, as now, the last line of the selection -
-
@guy038 said in Trick to easily bookmark one or several range(s) of lines, in the current file:
Tick the … Wrap around option
Untick the Backward direction optionMy experience has shown that, any time the
Wrap aroundcheckbox is ticked, the state of theBackward directioncheckbox is meaningless. -
Hi, @alan-kilborn and All,
Alan, thanks for this information ! I rarely use the backward direction and rather with normal search mode !
Indeed, when the
Wrap aroundoption is ticked, a click on buttons :-
Find All in Current Document -
Replace All -
Mark All
processes current file from beginning to end of file, whatever the state of the
Baskward directionoptionHowever, a click on buttons :
-
Find Next -
Replace
does depend on the state of the two independent options
Backward directionandWrap around
As for the other buttons :
-
Find All in All Opened Documents -
Replace All in All Opened Documents -
Find All -
Replace in Files
obviously, they act on the scanned files, from beginning to end, independently of the state of the options
Backward directionand/orWrap around!Cheers,
guy038
-
-
I was a little loose with my “any time” verbage. Your context was the
Markoperation, which was what I meant, but said poorly.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login