10

How do you change the tab spacing for TextEdit? The default is too big (8 spaces, I think).

I'm using OS X Mavericks.

  • Seems to already have been answered here: apple.stackexchange.com/questions/40040/… – Jabbath Jan 5 '14 at 19:45
  • 2
    no, that is not the answer. that is to change tab spaces in textEdit in formatted text files. I want to know if there is a way to change the system default tab spacing that will apply to all plain-text apps. - a system default if you will.. – Zach Smith Apr 24 '14 at 16:40
18

For plaintext tabs, you don't need to replace the entire TextEdit app to change it. I looked at the source they changed and it provides the simpler answer: Open the Terminal and type

defaults write com.apple.TextEdit "TabWidth" '4'

Where '4' is the number of spaces a tab should be.

  • This one break all my contents in my Mac OS T_T – user3595632 Jan 6 '18 at 12:03
  • @user3595632 "Contents"? If you mean table-of-contents, then I'm guessing you used tabs+spaces in them. You're changing the tab-width, so everything that comes with that needs to be assumed. – liquidblueocean Jan 15 '18 at 20:41
  • Works for me in version 1.13 (333). – ahcox Jul 19 '18 at 11:54
1

UPDATE APRIL 2015: This Textedit has stopped working for me. All windows are invisible.

A kindly soul has slightly modified TextEdit to add a field, "Tab Width", at the bottom of the "New Document" tab of the "Preferences" window.

Type in a number between 1 and 100 (inclusive) and it will change the width of tabs to that number (in character widths).

Download at code.google.com.

Since I couldn't replace the main TextEdit app, I renamed the modified one TextEditT.app.

[update] A better solution is to right click on both the old and new versions and select "show package contents". You can then replace the contents of the existing app with the contents of the tab-friendly app.

  • i don't understand why apple couldn't have made it like this. – Zach Smith Jan 7 '15 at 20:36
  • I don't think they've modified the program since it was introduced with OPENSTEP 4.0 in 1996, except to take into account new storage protocols (auto-save & iCloud). – Andrew Swift Jan 8 '15 at 10:00
  • Well the've added these annoying page borders that I can't seem to get rid of. And the previous version (in mavericks) you had to create a new document before you could type. But this kindly soul has done a good job - you open it and type, and as a bonus you can change tab sizes! – Zach Smith Jan 10 '15 at 7:36
0

TextEdit bases its tabs on distances, not number of characters.

If I set the text to 30pt, the tabs are four spaces. At 14pt, they are eight spaces.

Consequently, there is no set "number of spaces" that could ever be modified.

One solution is to:

  1. change your font preferences for RTF files to match my TXT preferences.

  2. temporarily convert your TXT files to RTF while editing (cmd-shift-T).

(do some editing)

  1. convert back to TXT when you quit (cmd-shift-T).

The RTF tabs default to 4 spaces for me -- it depends on the font and size.

  • a procedure such as this defeats the whole purpose of using text edit :p. thanks though – Zach Smith Jan 7 '15 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.