Hello, I'm a recent TextMate convert (from vim...)
I don't seem to be able to set up TM to handle tabs the same way. Here's the relevant snippet from my vimrc:
set tabstop=8 " Leave default for printing etc set softtabstop=4 " But use spaces between real tabs set shiftwidth=4 set noexpandtab " Use 'real' tabs (^I) when possible
This works great, real tabs (^I) are left alone at the usual 8 spaces, however I like to indent my blocks by 4 at a time. This tells vim to use a real tab if it can, and "pad out" with spaces at the end if the current indent isn't a multiple of 8. Here's what it looks like in vim:
<?php$ $page = new PageController($ 'shop.tpl',-$ array($ > 'showAds' => FALSE,$ > 'icon'> => 'shop'),$ 'Online Store');$ $page->render();$ ?>$
If I configure TM to use soft tabs at 4, then all my previous code looks wrong because it sets hard tabs to 4 as well. If I set it to 8, then my existing code looks fine but I'm not getting my desired softtab indent of 4.
This is a pretty annoying problem for me because I have hundreds of thousands of lines of code formatted this way :( Kind of ironic since I did it this way to maximize compatibility!
I guess what I'm looking for is the ability to set soft tab size independantly of hard tab size - the former to 4, the latter to 8. Is this possible??
(I suppose if there's no other option, I could convert all tabs to 8 spaces in all my files. However I like using tabs because it cuts down on file sizes a tiny bit. )
Thanks, Skye
On 23 Jul 2006, at 19:41, Skye Poier wrote:
This is a pretty annoying problem for me because I have hundreds of thousands of lines of code formatted this way :( Kind of ironic since I did it this way to maximize compatibility!
I agree - tab handling in TM is my main bugbear. Actually it's the only thing I'd change. It'd be great tab = 8 cols, indent = 4 cols mode. It'd make working with Makefiles that aren't recognised as such a load easier for a start.
On 23/7/2006, at 20:41, Skye Poier wrote:
[...] I suppose if there's no other option, I could convert all tabs to 8 spaces in all my files.
That would be the only option, I am afraid.
However I like using tabs because it cuts down on file sizes a tiny bit.
Then why don’t you use only tabs (with a size of four)? :)
I wouldn't touch mixed tabs and spaces with the standard-issue ten
feet pole...
It's worked very well for me so far, usually in editors when you say you want soft tab stops at 4 spaces it leaves hard tabs at 8.
[...] I suppose if there's no other option, I could convert all tabs to 8 spaces in all my files.
That would be the only option, I am afraid.
I was afraid you were going to say that :)
Is there a way to provide an argument to changeTabsToSpaces: in the macro recorder for stop size? Macro recording doesn't seem to notice when I change the tab stop, it's a pain to change the stops to 8, convert, then change back to 4 each time. And the macro is marked read-only (sorry, I'm still a TM n00b). I'd like to change files only as needed, and not have to drop to the shell to do a sed on it.
Skye
On Jul 23, 2006, at 7:39 PM, Skye Poier wrote:
Is there a way to provide an argument to changeTabsToSpaces: in the macro recorder for stop size? Macro recording doesn't seem to notice when I change the tab stop, it's a pain to change the stops to 8, convert, then change back to 4 each time. And the macro is marked read-only (sorry, I'm still a TM n00b). I'd like to change files only as needed, and not have to drop to the shell to do a sed on it.
Have you looked into the "Text -> Filter through command..." menu item? You can record a macro that uses that, or of course you can write a command. Anything you can do in the shell, you can wrap around a TM macro/command.
Skye
Haris
On 24/7/2006, at 2:39, Skye Poier wrote:
Is there a way to provide an argument to changeTabsToSpaces: in the macro recorder for stop size? [...]
As Haris suggests, use Filter Through Command… (or create a command [1].)
The shell command you want is: expand -t8 with input/output set to document/replace doucment.
Here’s an example, I gave it a key equivalent of F4:
Great, thanks very much!
Skye
On Jul 23, 2006, at 18:18, Allan Odgaard wrote:
On 24/7/2006, at 2:39, Skye Poier wrote:
Is there a way to provide an argument to changeTabsToSpaces: in the macro recorder for stop size? [...]
As Haris suggests, use Filter Through Command… (or create a command [1].)
The shell command you want is: expand -t8 with input/output set to document/replace doucment.
Here’s an example, I gave it a key equivalent of F4:
<Expand Tabs (8 Spaces).tmCommand>
[1] http://macromates.com/textmate/manual/commands ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate