tags:

views:

1606

answers:

5

My "Soft Tabs" setting in TextMate is not sticky. After I restart TextMate, I often have to set the option again for the same file. How can I make this setting the sticky default across all files?

+3  A: 
Georg
It is true that Textmate adjusts the softtabs settings per language. However the problem is, after I shut down Textmate and start again, that setting doesn't stick. I often have to set Soft Tabs again for the same language.
Kelvin
For me it sticks. Try to download the cutting edge version or check your permissions. (I don't know where TextMate stores this piece of information though…)
Georg
A: 

I found a popular TextMate plugin called "TabMate," which has solved this issue for me. While it requires me to add a tabline to every file, TextMate adjusts my tab settings to be whatever is described in the tabline.

Also, technically gs's answer above should work but for some reason it isn't working for me and I found no other way to set SoftTabs is the default setting for ALL languages forever.

TabMate: http://konstochvanligasaker.se/tabmate/

Kelvin
+4  A: 

You don't need anything special. You just need to adjust your Python bundle.

Go into the 'bundle editor' and find Python. Open its caret, and scroll down and find the 'miscellaneous' preferences. It should read something like:

{   decreaseIndentPattern = '^\s*(elif|else|except|finally)\b.*:';
increaseIndentPattern = '^\s*(class|def|elif|else|except|finally|for|if|try|with|while)\b.*:\s*$';
shellVariables = (
 { name = 'TM_COMMENT_START';
  value = '# ';
 },
 { name = 'TM_LINE_TERMINATOR';
  value = ':';
 },
);
}

These are the environmental variables. What you want is the environmental variable TM_SOFT_TABS to be set to 'YES'. Simple enough, Just insert a new assignment like so:

    { name = 'TM_SOFT_TABS';
  value = 'YES';
 },

...and voilà! Your tabs will be soft every time you use Textmate in Python mode.

For all the different enviornmental variables you can set, check out the manual here: http://manual.macromates.com/en/environment_variables.html

John McDonnell
This is written for python but it should work for other languages...
Adrian Archer
+5  A: 
DarthNerdus
A: 
  1. Create an alias icon for TextMate on the desktop.
  2. Drag the file to be opened to the icon.
  3. The file should now be opened in TextMate.
  4. Set the soft tab with the status bar options.
  5. Close TextMate.
  6. Repeat step 2 - 5 for each file type you want the soft tab settings to be remembered.
  7. Every time you want to open a file type with TextMate drag that file to that desktop icon.
  8. Do not open more than one file type at the same time, the second file type opened will get its soft tab settings erased.

This is the only way I've been able to get a consistant behavior on the soft tabs settings.