Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-convert tab to 4 spaces in TextWrangler?

Is there a preference in Textwrangler to redefine a tab as 4 spaces? In Vim this is set expandtab in the vimrc, but I don't know how to set it in TW besides clicking "Detab" when I'm done editing the document.

Thanks, Kevin

like image 811
Kevin Burke Avatar asked Apr 21 '11 22:04

Kevin Burke


4 Answers

Go to "Preferences" -> "Editor Defaults" -> "Auto-expand tabs," and then set tabs to 4 spaces. Then restart TextWrangler for changes to take place.

like image 122
Kevin Burke Avatar answered Oct 22 '22 09:10

Kevin Burke


For docs that already exist you have to hit the "Text Options" button in the top of the editor window of the open document. In older versions, it's the button that looks like a "T" with a light switch next to it; with newer versions, it's a gear "⚙" icon. In that drop down there is the "auto-expand tabs" as well.

like image 62
queso Avatar answered Oct 22 '22 07:10

queso


in version 4.5.5, there is 'Text -> Detab...', which pops up a requester for how many space per tab, preset for 4.

like image 9
robm Avatar answered Oct 22 '22 08:10

robm


Go to Edit -> Text Options and tick Auto-expand tabs. This will make all the new tabs to change to spaces.

To change all current tabs to spaces as well, go to Text -> Detab and hit Detab.

Hope that helps!

like image 6
Lukasz Czerwinski Avatar answered Oct 22 '22 07:10

Lukasz Czerwinski