8

Is there a way to show "Soft Tabs" (spaces) in TextMate? ViewShow Invisibles works well for keeping track of indentation if you're using tabs for indentation. Unfortunately in languages where indentation is semantic you generally have to use spaces. (Python, YAML, HAML, CoffeeScript)

Any suggestions for showing this whitespace or keeping track of soft indentation in TextMate? Should I keep holding out for Textmate2?

Alternative strategies and suggestions are also welcome.

dleavitt
  • 1,386
  • 13
  • 14
  • 3
    I'm thinking this post would be better on http://superuser.com/ or http://programmers.stackexchange.com – joce Apr 21 '11 at 06:16

2 Answers2

15

The latest version of TextMate 2 highlights spaces when Show Invisibles is enabled.

invisibles


EDIT:

You can even customize which invisibles to show with which character by modifying the invisiblesMap property in .tm_properties file.

From the TextMate changelog:

This can be set to a string which is used to control which glyphs are used for invisible characters. Add either \n, \t, or a space to the string, followed by the glyph that should be used to render the character, or prefix it with ~ to disable rendering of that character. For example to disable rendering of spaces and render tabs as add this to .tm_properties: invisiblesMap = "~ \t┊".

Sidenote:

THIS IS NOT THE CASE ANYMORE, functionality has been restored.

According to the Log of 2013-10-23 (v2.0-alpha.9489): "Show Invisibles will no longer treat space as an invisible (which was added in previous build) as it was causing issues with right-to-left rendering and combining marks used after spaces. The feature might be back, but needs to be implemented differently."

Community
  • 1
  • 1
Koen.
  • 25,449
  • 7
  • 83
  • 78
  • Where is the `.tm_properties` file located? – Pavel Nikolov Oct 10 '13 at 11:54
  • 2
    TextMate will first look in the current directory (eg. your project folder) and then will traverse up the document tree to look for a `.tm_properties` file. User defaults can be defined in your home folder (`/Users/username/.tm_properties`). TextMate defaults are in `~/Library/Application Support/TextMate/Global.tmProperties` – Koen. Oct 10 '13 at 14:05
  • 3
    Thanks for this. To my great demise spaces showed up in the latest version, and code became unreadable for my eyes. Adding a `~/.tm_properties` file with `invisiblesMap = "~ "` inside did the trick. – Raf Oct 10 '13 at 14:33
  • 1
    Thank you so much! @Raf I had the same problem and now everything is awesome again :) – Pavel Nikolov Oct 11 '13 at 06:29
  • Glad I could help @PavelNikolov, the feature seems have been remove ATM, but may be back. According to the Log of 2013-10-23 (v2.0-alpha.9489): "Show Invisibles will no longer treat space as an invisible (which was added in previous build) as it was causing issues with right-to-left rendering and combining marks used after spaces. The feature might be back, but needs to be implemented differently." – Raf Oct 24 '13 at 07:32
  • Yeah I just read that in the release notes of the last update yesterday. It was very annoying feature. – Pavel Nikolov Oct 24 '13 at 08:16
  • It's sad to see this feature go away, it's crucial for some of us who moved to Sublime for the lack of it. Here is the link to the two changelog posted in the original response: https://github.com/textmate/textmate/blob/21656845928bc850fb467ad5c7b72be5a669a44a/Applications/TextMate/about/Changes.md – Leonel Galán Feb 03 '14 at 15:41
-1

You can use soft tabs - as described here. I have also problem to find it when I needed this feature;)

Zap
  • 259
  • 1
  • 3
  • 10
  • 2
    I believe he's asking not how to use soft spaces, but how to make them visible as tabs are when showing invisibles. – Chuck Apr 21 '11 at 19:03