在 TextWrangler 中自动将制表符转换为 4 个空格?
Textwrangler 中是否有将制表符重新定义为 4 个空格的首选项?在 Vim 中,这是 vimrc 中的 set Expandtab
,但我不知道如何在 TW 中设置它,除了在编辑完文档后单击“Detab”之外。
谢谢, 凯文
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
转到“首选项”-> “编辑器默认值”-> “自动展开制表符”,然后将制表符设置为 4 个空格。然后重新启动 TextWrangler 以使更改生效。
Go to "Preferences" -> "Editor Defaults" -> "Auto-expand tabs," and then set tabs to 4 spaces. Then restart TextWrangler for changes to take place.
对于已经存在的文档,您必须点击打开文档的编辑器窗口顶部的“文本选项”按钮。在旧版本中,该按钮看起来像“T”,旁边有一个灯开关;在较新的版本中,它是一个齿轮“⚙”图标。在该下拉列表中还有“自动扩展选项卡”。
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.
在4.5.5版本中,有“文本->” Detab...',会弹出一个请求者,询问每个选项卡有多少空间,预设为 4。
in version 4.5.5, there is 'Text -> Detab...', which pops up a requester for how many space per tab, preset for 4.
转到
编辑
->文本选项
并勾选自动展开选项卡
。这将使所有新选项卡更改为空格。要将所有当前制表符也更改为空格,请转到
Text
->Detab
并点击Detab
。希望有帮助!
Go to
Edit
->Text Options
and tickAuto-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 hitDetab
.Hope that helps!
对于 Mac,检查并启用“自动展开选项卡”的另一种简单方法是点击左上角的齿轮按钮。
For Mac, another easy way to check and enable "Auto-expand tabs" is to hit the gear button on top left.
您还可以使用“标准化选项...”将已打开文档的文本选项设置为您在首选项中设置的任何内容。这对于处理预先存在的代码很有用。
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.
您需要在两个地方进行设置才能使其发挥作用。一个用于以前打开的文档,另一个用于将来打开或创建的所有文档。
设置
先前打开的文档
新文档
There are two places you need to set the settings for this to work. One is for previously opened documents, and the other for all documents to be opened or created in the future.
The Settings
Previously Opened Documents
New Documents