[TxMt] Indent size different from tab size

Charilaos Skiadas skiadas at hanover.edu
Thu Nov 9 16:08:44 UTC 2006


On Nov 9, 2006, at 10:06 AM, James Milne wrote:
> On 9 Nov 2006, at 14:37, Nick Sieger wrote:
>> On 10/27/06, James Milne <james.milne at mac.com> wrote:
>> Hello,
>>
>> I am working a lot with source code written using Emacs on Linux. The
>> prevailing convention is that tabs are presented as 8 spaces, but
>> indents are only 4 spaces. Indenting will insert spaces, and Emacs
>> seems to swap groups of 8 spaces for a tab.
>> Is there any way to do this with TextMate at the moment?
>>
>> Not mentioned so far is that you're probably best off setting  
>> tabsize to 8, converting all tabs to spaces, and then switching  
>> back to 4-space soft-tabs.
>>
>> I have seen that type of tab encoding before as well, but any  
>> emacs hacker worth her salt [1] uses "(setq indent-tabs-mode nil)".
>
> Sadly I'm going to get short shrift informing my emacs hackers that  
> they have to change their coding style just to suit my choice of  
> editor :-)
>
> Also, I don't want to change the whitespace in these files, as it  
> means I'm touching every line in the source file. This makes my  
> diff more complicated when I check back into CVS. When someone else  
> has to resolve conflicts with their merges they would find I had  
> changed every single line in the file, most of which is just  
> replacing tabs with spaces. Again, not going to be very popular :-)
>
> It's the only usability niggle I have with TextMate. I keep  
> learning more funky keyboard shortcuts every day which make it a  
> great environment otherwise!

Is it hard to write a command that simply goes through all the files  
in the current project and toggles between the two tabbing styles?  
Unless I'm mistaken, Allan might have already written one such.

Then all you'll have to do is run this command before you commit your  
changes. You could perhaps even put this command in a .textmate_init  
file so that you don't have to remember running it each time, though  
I guess this might be a bit more complicated.

Sure it is a bit more work than if the editor supported it natively,  
but it's doable I think.

> --
> Kind regards,
> James Milne

Haris





More information about the textmate mailing list