Jump to a Line Number in TextEdit Documents on the Mac

Feb 3, 2015 - 9 Comments

TextEdit icon

TextEdit is a surprisingly handy Mac app that is mostly underutilized and under appreciated, and while it’s certainly not going to compete with the abilities of pro text editors like BBEdit and TextWrangler, it can function as a simple code editor in a pinch. One of the quintessential features of any good text editor is the ability to jump to a specific line number, and TextEdit can do that.

To jump to any specific line in TextEdit, have a document open and then hit Command + L to bring up the “Select Line” tool. Then you just need to enter the line number and hit Return to move directly to and select that specified line of text in the active text document.

Line numbers in Text Edit selector tool

There is one small problem here, which you may have noticed already… TextEdit doesn’t display line numbers, and there is no option to show them.

Select a line number in TextEdit documents for Mac OS X

This obviously makes it a bit cumbersome to jump around to line numbers since you’d be relying on memory, another app, or someone else telling you what line number to see or edit, which realistically means you should be using a professional text editing app. Perhaps it’s not too surprising to have a Select Line tool in TextEdit, but it is a little weird to be missing the line number display given the inclusion of the line jump feature. (On a side note, you can manually hard code line numbers to a document, but that would never be a good idea for something like source code).

For best results with this, you’ll probably want to have set TextEdit to be Plain Text by default, kind of like Notepad from the Windows world, otherwise TextEdit opens a file as Rich Text which can lead to irregularities.

Realistically, if you’re doing anything complex that either requires line numbers or is aided by them, you should really just download TextWrangler, which is free and quite good and yes it displays line numbers, or go with BBEdit, which is paid and for the pros. Either way, it will make your life easier.

.

Related articles:

Posted by: Paul Horowitz in Mac OS, Tips & Tricks

9 Comments

» Comments RSS Feed

  1. Mojave Textedit displayed line numbers, which is invaluable in 1000+ lines of hard calculating code.

    Monterey does not allow, even as an option, line numbers. Why? WHY??

    This reminds me of “planned obsolescence” by the brilliant Detroit auto makers of the 1950s … so Japan made cars that lasted 10+ years and wiped out Detroit for decades.

    The Chinese might copy Mac with reasonable, simple, productive apps. They will outsell you in the world.

    • Paul says:

      BBEdit is an excellent Mac text editing app with line numbers, jumping, find/replace, all the standard text editor stuff. It is free but offers even more advanced features for a fee.

  2. Ben Floys says:

    This is ridiculous to have a text editor and not have the option of having the line number, i also did not see any setting for configuring the tab length. In anycase not having line number is such an arrogant decision of Apple that i totally refuse to use it.

    Thanks for this article.
    Cheers.

  3. Dnadave says:

    Actually, you CAN number all the lines in a TextEdit doc:
    Select all, then hit the last item in the outlining drop down: 1,2,3…
    All of your lines will be numbered and the select line tool will go to the correct line!

  4. Corey says:

    When i am working on a file or trying to code i use the program Text Wrangler. Its great its free and it keeps track of all your lines and gives you color coding.

  5. Corey says:

    i use the program text wrangler it has line numbers and color coding.

  6. Brain Dead Homer says:

    Hello .. It’s textedit, who cares. For anything of importance were going to use MS Notepad. No worries, Homer has this one figured out.

    • Paul says:

      Sometimes the best text editor you have is the one you have in front of you (kind of like that old camera adage), particularly for modifying text files in the GUI. Of course, turning to nano or VIM is more practical for advanced users, but still TextEdit can get the job done in many situations. But yes indeed, it is a lot like MS Notepad!

  7. mazzoo la says:

    Weird, TextEdit should have line numbers

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site