Auto-convert tab to 4 spaces in TextWrangler?

2019-01-22 10:17发布

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

6条回答
趁早两清
2楼-- · 2019-01-22 11:02

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

查看更多
啃猪蹄的小仙女
3楼-- · 2019-01-22 11:04

For docs that already exist you have to hit the "Text options" button in the top of the editor window of the open document. It's the button that looks like a "T" with a light switch next to it. In that drop down there is the "auto-expand tabs" there as well.

查看更多
老娘就宠你
4楼-- · 2019-01-22 11:13

For Mac, another easy way to check and enable "Auto-expand tabs" is to hit the gear button on top left.

gear button

查看更多
手持菜刀,她持情操
5楼-- · 2019-01-22 11:17

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

查看更多
虎瘦雄心在
6楼-- · 2019-01-22 11:19

You can also use "Normalize Options..." to set the text options of an already-open document to whatever you have set in your Preferences. This is useful for dealing with pre-existing code.

查看更多
时光不老,我们不散
7楼-- · 2019-01-22 11:22

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!

查看更多
登录 后发表回答