13

I'm using the Soft Tabs option in TextMate, but my files still contain TAB characters instead of "4-spaces". This is how it works:

  1. I open a file, it contains TABs
  2. I turn on the Soft Tabs option
  3. I save the file.

Nothing is changed, the file is still full of TABs. What am I doing wrong?

2
  • Which part of the documentation claims that it will replace existing tab characters? Commented Mar 15, 2011 at 6:30
  • @Ignacio hm... This is what I'm reading: manual.macromates.com/en/working_with_text section 4.11. I had a feeling that it has to replace existing TABs. What is the workaround?
    – yegor256
    Commented Mar 15, 2011 at 6:34

2 Answers 2

30

TextMate does not change your entire document based on such a preference. It is across document boundaries, so just the act of opening a file would change nearly every single line in it. Your colleague who always read the VCS change logs would want to kill you.

The file is not updated automatically. In TextMate 1, you need to invoke Text » Convert » Tabs to Spaces. In TextMate 2, you invoke Bundles » Source » Convert Tabs to Spaces. Both respect your current tab width setting.


Regarding the linked documentation:

When soft tabs are enabled, TextMate will for the most part act exactly as if you were using hard tabs but the document does indeed contain spaces.

This refers to navigation across multiple spaces. Even if you use spaces, moving the cursor will feel like they were tabs (i.e. jumping $tab_width spaces).

1
  • 4
    ctrl-appl-shift-t and then 2
    – AJcodez
    Commented Nov 17, 2013 at 21:31
1

This is an old post, but, just in case somebody stumbles into it. Textmate allows you switch from tabs into spaces.

IMG:

You can set the at the bottom left-ish of the window where it says, "tab siz: 4"; click on it, and you will be able to switch to spaces.

1
  • I'm glad I found this. I hunted in the menus and you can set tab size, but nothing about using spaces. Changing the setting here is hard to find.
    – Jim Leask
    Commented Oct 20, 2021 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .