[TxMt] Re: Convert tabs to spaces when saving?

Steve King sking at arbor.net
Thu Jun 17 23:00:20 UTC 2010


On 2010-06-17 16:12, Daedal wrote:
> I was wondering if there was maybe a hack or plugin that will allow me to do
> this? I'm required to convert all tabs to spaces before committing any code,
> and having to do it manually (text->convert->tabs to spaces) on every file
> can get pretty frustrating.
>    

The first thing I'd recommend is to turn on soft tabs (bottom of the 
window, in the tab size selector). This will insert spaces instead of 
tabs, so there won't be anything to convert when it's time to save.

If you still want to automatically run the tabs-to-spaces conversion, 
record it as a macro. Start recording, do tabs-to-spaces, save the file, 
and stop recording. Then save the macro, go into the bundle editor, and 
set its activation to "Key Equivalent" and set the key to ⌘-S. Now 
hitting ⌘-S will convert tabs before saving the file. (It's not a 
perfect solution though; the File->Save menu item will still have its 
regular behavior.)

-- 
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461
www.arbornetworks.com <http://www.arbornetworks.com/>




More information about the textmate mailing list