I would like to find and replace text once, without jumping to the next.

  • When I create a couple of regular expressions for find and replace I would like to be able to do the find and replace operation only once and examine whether the regex has worked. However as soon as the change is made the next occurrence is found, and I can’t see the change that was made. I’ve taken to checking the line number, doing find and replace, then clicking elsewhere and using Ctrl+G to go back to the line that was changed.

    Is there any way to tell N++ to make a single replacement and not move to find the next one?

  • @David-Baines

    I don’t know of a switch/parameter which would prevent jumping to next text but
    maybe a quicker solution to your problem is to press ctrl+z (undo) and ctrl+y (redo)
    which results in having the cursor in the line of the last change.
    You could even record a macro and assign a shortcut to have only one shortcut to press.
    No worries about line numbers any more.


  • Thanks Claudia, that’s a great idea! I’d thought about using a macro but I wasn’t sure how to get a macro to ‘know’ the line number to jump back to. This works well.

    In case it is useful to anyone else I couldn’t record a macro using CTRL + Z and CTRL + Y and then save it. When I tried that the ‘Save Current Recorded Macro’ option was greyed out. However when I recorded a macro using the Edit Menu options Undo and Redo I was able to save it.

    So now I have Alt + Space as a shortcut to Jump to last edit which is useful.
    Many Thanks.

Log in to reply