I've just been troubleshooting why so many of my files have hard tabs in them. Now I see that whenever I create a new file in TextMate, it defaults to hard tabs. Two questions:
(1) How do I have TextMate automatically assume soft tabs 2 when I create a new file?
(2) Is there a way to have TextMate convert hard tabs to soft tabs on save, so I can easily fix this mess?
I think once upon a time I knew that I had to manually set soft tabs for each new file, but at some point I forgot.
~joe
TM should -- assuming I'm remembering this correctly! -- remember the soft tab setting on a per filetype basis. If you set "soft tabs, 4 spaces per tab" when an HTML file is open and save that file that way, the next time you open an HTML file, it'll be opened in soft tabs, 4 spaces per tab.
There's a menu command to convert hard tabs to soft tabs, which you probably already know about; I don't know of a way to automatically link that to the 'save' action, though.
- Watts
On Wed, Oct 20, 2010 at 8:56 AM, Joe Lapp arachnojoe@gmail.com wrote:
I've just been troubleshooting why so many of my files have hard tabs in them. Now I see that whenever I create a new file in TextMate, it defaults to hard tabs. Two questions:
(1) How do I have TextMate automatically assume soft tabs 2 when I create a new file?
(2) Is there a way to have TextMate convert hard tabs to soft tabs on save, so I can easily fix this mess?
I think once upon a time I knew that I had to manually set soft tabs for each new file, but at some point I forgot.
~joe
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 20 Oct 2010, at 19:43, Watts Martin wrote:
TM should -- assuming I'm remembering this correctly! -- remember the soft tab setting on a per filetype basis. If you set "soft tabs, 4 spaces per tab" when an HTML file is open and save that file that way, the next time you open an HTML file, it'll be opened in soft tabs, 4 spaces per tab.
This certainly isn't happening for me - I end up changing to soft tabs pretty much every day :-/
Nigel. -- [ Nigel Metheringham Nigel.Metheringham@InTechnology.com ] [ - Comments in this message are my own and not ITO opinion/policy - ]
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.
Helpful? Try opening the file in VIM to see if you have love. (http://manual.macromates.com/en/working_with_text)
On Wed, Oct 20, 2010 at 3:49 PM, Nigel Metheringham nigel.metheringham@dev.intechnology.co.uk wrote:
On 20 Oct 2010, at 19:43, Watts Martin wrote:
TM should -- assuming I'm remembering this correctly! -- remember the soft tab setting on a per filetype basis. If you set "soft tabs, 4 spaces per tab" when an HTML file is open and save that file that way, the next time you open an HTML file, it'll be opened in soft tabs, 4 spaces per tab.
This certainly isn't happening for me - I end up changing to soft tabs pretty much every day :-/
Nigel.
[ Nigel Metheringham Nigel.Metheringham@InTechnology.com ] [ - Comments in this message are my own and not ITO opinion/policy - ]
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Wed, Oct 20, 2010 at 1:43 PM, Watts Martin layotl@gmail.com wrote:
TM should -- assuming I'm remembering this correctly! -- remember the soft tab setting on a per filetype basis. If you set "soft tabs, 4 spaces per tab" when an HTML file is open and save that file that way, the next time you open an HTML file, it'll be opened in soft tabs, 4 spaces per tab.
This appears to be correct. However, something doesn't work with this solution. My files are now a mix of hard and soft tabs. My older edits are soft tabs, my newer are hard tabs. My edits are all now back to soft tabs, though I'm not entirely sure what I did to fix this.
Perhaps I accidentally changed soft tabs to hard tabs in some file, without realizing it? I recall once or twice accidentally popping up that status bar tab menu. Maybe that's just not a safe place for the tab setting. I now have to clean up who knows how many files.
Or perhaps something else went wrong? Did I lose my tab settings on a TextMate update and not know to go in and re-set them?
There's a menu command to convert hard tabs to soft tabs, which you probably already know about; I don't know of a way to automatically link that to the 'save' action, though.
Actually, I spent some time looking for it, but hearing you say it's there got me systematically going through the menu until I found it. I've got it now (Text -> Convert -> Tabs to Spaces).
Thank you! Macromates, please find something to fix! ;o)
~joe
On Oct 20, 2010, at 8:53 PM, Joe Lapp wrote:
Or perhaps something else went wrong? Did I lose my tab settings on a TextMate update and not know to go in and re-set them?
That is a non-zero possibility, I suspect. The possibility that there is indeed a minor bug relating to this in TextMate somewhere is also non-zero. I admit that I'm not using TM much these days due to another minor bug -- and the lack of bug fix updates for the last year.
- Watts