如何增加 Xcode 中行之间的距离?我的意思是在实际代码中。
即使我在 Xcode 首选项中更改了字体和字体大小,代码行仍然靠得太近,很烦人。
还可以查看Meslo 字体;Menlo 的开源定制版本,具有更好的行间距。
在 Xcode 9 之前,无法更改行高。但是,现在在 Xcode 9 中,该选项在 Xcode>Preferences...>Fonts & Colors 下可用,底部有一个弹出窗口,其中包含“Tight Spacing”、“Normal Spacing”和“Relaxed Spacing”选项。
从 Xcode 9 开始,您可以打开主题文件并通过属性指定所需的行距DVTLineSpacing
。1.5 行距的示例:
<key>DVTLineSpacing</key>
<real>1.5</real>
尝试使用免费的开源Droid Mono字体。它在字体本身中内置了更多的行距。
XCode 4 中紧凑的行距也让我抓狂!
Create a custom font with whitespace on the top and bottom of the glyphs, install it and set is as the editing font in Xcode.
阅读:
http ://hivelogic.com/articles/top-10-programming-fonts
并下载您喜欢的字体并解压缩。之后打开Mac的TextEdit and Format-->Font-->Show Fonts-->点击左下角“+-”旁边的设置-->Manage Fonts-->点击“+”添加刚刚的字体下载。
现在你已经成功地在你的 Mac 中添加了一种字体,你可以在你的 Xcode 首选项中选择这个字体。新字体的行高已更改。
编辑文件中的DVTLineSpacing
属性.xccolortheme
以更改行高。
打开任何.xcolortheme
文件~/Library/Developer/Xcode/UserData/FontAndColorThemes
编辑DVTLineSpacing
密钥。如果没有,请将其添加到文件中,替换1.8
为您想要的行距:
<key>DVTLineSpacing</key>
<real>1.4</real>
默认情况下,Xcode 使用1
紧密间距,常规间距没有键,以及1.2
宽松间距。
使用 Xcode 12.2 和 Mac OS 10.15 测试。