有没有办法让空白在 Xcode 编辑器中可见?
我希望制表符和空格在 Xcode 中可见。 这可能吗? 我在偏好设置下找不到它。
I want the tabs and spaces to be visible in Xcode. Is this possible? I can't find it under preferences.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
编辑-> 在 Xcode 4 中显示不可见项
Editor -> Show Invisibles in Xcode 4
在 Xcode 7 及更高版本中,此命令已移至编辑器菜单:
Editor > 显示隐形
或
编辑器> 隐藏不可见
编辑
从 Xcode 12.1 开始,菜单项现在简称为Invisibles。 当显示不可见物体时它被选中,当它们不显示时它被取消选中。
此外,看起来 Xcode 现在使用非常浅的蓝色点表示空格,并使用粗体浅蓝色点表示与选项卡位置相对应的空格,这非常好。
In Xcode 7 and later, this command has moved to the Editor menu:
Editor > Show Invisibles
or
Editor > Hide Invisible
Edit
As of Xcode 12.1, the menu item is now simply called Invisibles. It's checked when invisibles are shown, and un-checked when they are not shown.
Further, it looks like Xcode now uses very light blue dots for spaces, and bold light blue dots for the spaces that correspond to your tab positions, which is very nice.
您还可以使用默认值读取/写入 Xcode
plist
中使用/测试
这在 Xcode
6.1
GUIEditor->Show Invisibles
CLI
打开它
打开它离开
You can also use defaults to read/write to the Xcode
plist
This is used/tested in Xcode
6.1
GUI
Editor->Show Invisibles
CLI
Turn it on
Turn it off
自 Xcode
11
起:在菜单中选中/取消选中:
编辑器-> 隐形人
Since Xcode
11
:In the menu check/uncheck:
Editor -> Invisibles
它位于编辑器 -> 下。 看不见的东西。 您可以选中它来显示它们,或者取消选中它来隐藏它们。
关于 macOS 的说明
在 mac 环境中,您可以在帮助菜单下搜索任意菜单选项,然后它将打开您要查找的确切菜单路径。 例如,搜索 invisibles 会产生以下结果:
It is under Editor -> Invisibles. You can check it to show or uncheck it to hide them.
A note about the macOS
In the mac environment, you can search for any menu option under the Help menu, then it will open the exact menu path you are looking for. For example, searching for invisibles results in this:
在 Xcode 6.x 及更早版本中:
查看 -> 文字-> 显示空间
视图 -> 文字-> 显示控制字符
In Xcode 6.x and earlier:
View -> Text -> Show Spaces
View -> Text -> Show Control Characters
您还可以在搜索字段中输入空格,这会暂时以黄色突出显示所有空格。 我在这里偶然发现了这一点,Marty 反过来问: 这些黄色是什么Xcode 中的间隔符?
You can also enter a white space into the search field, this will highlight all white spaces in yellow temporarily. I found this accidentally here, where Marty asked the other way around: What are these yellow spacers in Xcode?