macOS text editor with tab stops for display

Has anyone, anywhere written a text editor that allows you to set tab stops (like a typewriter) for display purposes? I.e., I want to be able to type one tab within a line of text, not multiple tabs, and have the text after the tab display at the point where I’ve set the tab stop. In every text editor I’ve used, I have to choose between typing a single tab and maybe not having things line up visually, or typing multiple tabs or spaces, which creates problems if I then want to paste the text into a spreadsheet or rich text word processor.

If I understand right, then BBEdit might work for you. (App is free to use, with 3-day trial mode unlocked. $50 to keep unlocked.)

Hitting Enter sends you to the next line, indented. And Typing within a line and hitting Tab will send you to the next tab stop.

Vim in the terminal (part of the OS) or MacVim as regular Mac app can do what you want. There is a setting that allows you specify how many spaces a tab stop is equivalent to. You can set it globally for all files and override it for just the current file. The default value is 8. There is a separate setting that controls whether pressing tab inserts a tab character or the equivalent number of actual spaces. See the second main comment on this page: https://stackoverflow.com/questions/1878974/redefine-tab-as-4-spaces

1 Like

I guess I wasn’t very clear.

I want lines that have a lot of text 	followed by one tab and more text, and lines with just
a little 	to line up.

Was told on Twitter that Brett Terpstra’s upcoming nvUltra will have “elastic tab stops” — still not sure that’s exactly what I was asking for, but it’s very close.

Atom might work for you. In the preferences of Atom you’d want to set the tab type to Hard and the tab length to 40 (or something). When you hit the tab key the cursor moves to column 41 regardless of if the start of the line contained 2 characters or 20.
Is this what you meant?

Yes, that’s it. Can I set more than one stop?

Looks like you can set the tab length to what ever you like however there is only one setting. I don’t think you can set separate intervals.
If you set the tab length to 40 (as an example) then first tab press would take you to column 41, next tab press would take you to 81, then 121.
I do not think that you could set it up to have the first tab stop at 35, next at 80 and another at 90 for example.
The only way I’d know of doing that sort of thing is to use something like Pages, show the ruler and manually drag on / double click to set tab-stops at the desired positions.
**edit**
Actually, I’ve just opened Mac’s built in TextEdit app and it’s got exactly that function in it. There’s a ruler across the top and you can drag your tab stops to where ever you want them. Pressing Tab then just jumps to where ever you’ve got the next tab stop set.

to find the tab settings in Atom, open Atom, open the preferences from the Atom menu, it’ll show the settings tab. Choose Editor from the sidebar and scroll all the way down, tab type and length options are at the bottom there. :slight_smile:

On my system TextEdit only shows the ruler in rich text mode.

Ah, yes, so it does.

To be fair, I think you’re fighting the file format more than the editors. Plain text is a rather simple format and only records that there is a tab character rather than properties about it. As such you’re always going to get inconsistent results when pasting else where and depending on if your editor and / or target application is using soft tabs (replacing the tab with spaces) or hard tabs (an actual character). The other thing that can make a mess of this is if you’re using a variable width font over a fixed width one.

Hopefully that Atom editor will get you most of the way to a solution though personally, if what I’m doing absolutely has to be column aligned I just use a spreadsheet (feels excessive but gets the job done! :slight_smile: )

Good luck, hope you find something that works for you!

What is your larger goal? That is, what are you using this formatted text for?

Anything and everything. I’m constantly jotting down notes of one kind or another in Drafts or BBEdit. But it’s mainly an issue with text that I later want to paste into a spreadsheet or rich text word processor, or somewhere else where I don’t want a row of multiple tabs. I’ll try Atom or wait for nvUltra.