Notepad++ Go to line

Sometimes when you are editing a text file, you want to go to a specific line. Here’s how you go to a line in Notepad++, along with a few more go to tricks.

Notepad++ go to line
You can find the Notepad++ Go to line option in the Search menu, about halfway down. Or use the Ctrl-G keyboard shortcut.

Notepad++ has a menu option for go to, which you can find in the search menu. Click Search, then pick Go to from the drop down menu. It’s a little more than halfway down, 14 from the top and 11 from the bottom if you’re counting. Go to line is the default option in the resulting dialog box.

Type in the line number in the field labeled I want to go to, then click OK. Or if you change your mind and want to cancel, click the button labeled I’m going nowhere.

The hard part is remembering where to find it. But here’s a power user trick you can use.

How to remember Notepad++ Go to line

Maybe it’s just me, but it’s kind of hard to remember to look for Go to in the Search menu. Search seems like a bit of an odd place to put Go to. But looking at the menus, admittedly I can’t find any other place it seems to fit better. So I completely understand why they put it there.

I always use the keyboard shortcut, which is Ctrl-G. I remember it by remembering that G is for Go to, the same way I remember H is for hunt to remember Find with Replace. That’s easier for me to remember than remembering to look in the search menu. It’s also the same keyboard shortcut in some other text editors, like boring old Windows Notepad.

Go to line is probably the go to option you’ll use most frequently in Notepad++. It’s useful when you know the specific line number you want to go to. Whenever I write a script that has a hard-coded default option, I always leave a comment somewhere in the code saying which line number I defined that in.

But the nice thing about Notepad++ is that its go to functionality has a couple more options that you might use occasionally.

Notepad++ Go to offset

Hiding in the same dialog box as the Notepad++ Go to line option is the offset option. The offset option allows you to move to a specific byte or character in the file, rather than a specific line. I use this option less frequently but it’s useful for quickly jumping to the middle of the file, for example.

Notepad++ Go to matching bracket

Notepad++’s final Go to option is its Go to matching bracket option. This option is useful in code. When you have a lot of nested brackets in your code, it can be easy to lose track of them and accidentally insert an extra one, or leave one out. At least in my experience. Mismatched brackets make up a high percentage of my coding mistakes, so this function helps me a lot when troubleshooting.

Go to matching bracket is also in the Search menu, right below regular Go to, and its keyboard shortcut is Ctrl-B. You can remember this one as B is for bracket.

I spend a lot of time in Notepad++, and the Go to function is something I use quite a bit.

A bit of a rant

I think Notepad++ is a good example of a good UI. Pull down menus are no longer in vogue, but the nice thing about them is they teach you how to use the tool more efficiently. Use the menus for a while and you see the keyboard shortcuts right next to them, so eventually you get used to seeing them and you remember them. You don’t get that with ribbons. We built GUIs that way for more than 20 years and then around 2007 someone decided it was time to change it, and I think it was a big step backwards. I appreciate how Notepad++ doesn’t treat you like a beginner for your entire life.

If you found this post informative or helpful, please share it!

3 thoughts on “Notepad++ Go to line

  • April 28, 2023 at 11:30 am

    Whilst I use (ordinary) notepad for editing simple text files (txt). I think Notepad++ is absolutely brilliant for code editing when you don’t have a reasonable IDE to fall back on.

  • May 2, 2023 at 10:40 am

    Ctrl-Alt-Shift-B – Pretty Print XML within XML tools.
    Let’s not forget about the power of plugins 🙂

Comments are closed.

%d bloggers like this: