前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >为Xcode的代码编辑器自定义主题

为Xcode的代码编辑器自定义主题

作者头像
Cloudox
发布2021-11-23 13:08:10
5670
发布2021-11-23 13:08:10
举报
文章被收录于专栏:月亮与二进制

Xcode的代码编辑器是可以进行主题设置的,如果是白色背景一般会比较伤眼,所以都会修改一些主题。

在Xcode菜单栏中进行偏好设置,可以设置Fonts&Colors,它会提供一些现有的主题,可以对现有的主题进行颜色、字体大小的设置:

也可以自行进行设置,或者下载其他人设置好的主题文件,导入到Xcode中去。比如我这个主题:

主题文件都是xml写的,内容在文末可以直接复制,新建一个文件命名为Monokai.dvtcolortheme,将文末的xml内容复制进去就可以了。

然后将这个主题文件放到Xcode的主题文件夹中,这个文件夹通过终端来打开比较方便,路径是:~/Library/Developer/Xcode/UserData/FontAndColorThemes/

放进去后重启一下Xcode,就可以在偏好设置中看到他了,选中就可以了,我习惯将所有文字大小都调成18,比较大,看起来对眼睛好一些,也可以把背景调成护眼色(色调:55,饱和度:123,亮度:205,红:199,绿:237,蓝:204)。

主题内容:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
<plist version="1.0">  
<dict>  
    <key>DVTConsoleDebuggerInputTextColor</key>  
    <string>0.973 0.973 0.941 1</string>  
    <key>DVTConsoleDebuggerInputTextFont</key>  
    <string>Menlo-Regular - 12.0</string>  
    <key>DVTConsoleDebuggerOutputTextColor</key>  
    <string>0.973 0.973 0.941 1</string>  
    <key>DVTConsoleDebuggerOutputTextFont</key>  
    <string>Menlo-Regular - 12.0</string>  
    <key>DVTConsoleDebuggerPromptTextColor</key>  
    <string>0.973 0.973 0.949 1</string>  
    <key>DVTConsoleDebuggerPromptTextFont</key>  
    <string>Menlo-Regular - 12.0</string>  
    <key>DVTConsoleExectuableInputTextColor</key>  
    <string>0.973 0.973 0.941 1</string>  
    <key>DVTConsoleExectuableInputTextFont</key>  
    <string>Menlo-Regular - 12.0</string>  
    <key>DVTConsoleExectuableOutputTextColor</key>  
    <string>0.973 0.973 0.949 1</string>  
    <key>DVTConsoleExectuableOutputTextFont</key>  
    <string>Menlo-Regular - 12.0</string>  
    <key>DVTConsoleTextBackgroundColor</key>  
    <string>0.153 0.157 0.133 1</string>  
    <key>DVTConsoleTextInsertionPointColor</key>  
    <string>0.973 0.973 0.941 1</string>  
    <key>DVTConsoleTextSelectionColor</key>  
    <string>0.219608 0.219608 0.188235 1</string>  
    <key>DVTDebuggerInstructionPointerColor</key>  
    <string>0.705792 0.8 0.544 1</string>  
    <key>DVTSourceTextBackground</key>  
    <string>0.153 0.157 0.133 1</string>  
    <key>DVTSourceTextBlockDimBackgroundColor</key>  
    <string>0.153 0.157 0.133 1</string>  
    <key>DVTSourceTextInsertionPointColor</key>  
    <string>0.973 0.973 0.941 1</string>  
    <key>DVTSourceTextInvisiblesColor</key>  
    <string>0.153 0.157 0.133 1</string>  
    <key>DVTSourceTextSelectionColor</key>  
    <string>0.219608 0.219608 0.188235 1</string>  
    <key>DVTSourceTextSyntaxColors</key>  
    <dict>  
        <key>xcode.syntax.attribute</key>  
        <string>0.4 0.851 0.937 1</string>  
        <key>xcode.syntax.character</key>  
        <string>0.682 0.506 1 1</string>  
        <key>xcode.syntax.comment</key>  
        <string>0.459 0.443 0.369 1</string>  
        <key>xcode.syntax.comment.doc</key>  
        <string>0.459 0.443 0.369 1</string>  
        <key>xcode.syntax.comment.doc.keyword</key>  
        <string>0.459 0.443 0.369 1</string>  
        <key>xcode.syntax.identifier.class</key>  
        <string>0.651 0.886 0.18 1</string>  
        <key>xcode.syntax.identifier.class.system</key>  
        <string>0.4 0.851 0.937 1</string>  
        <key>xcode.syntax.identifier.constant</key>  
        <string>0.651 0.886 0.18 1</string>  
        <key>xcode.syntax.identifier.constant.system</key>  
        <string>0.4 0.851 0.937 1</string>  
        <key>xcode.syntax.identifier.function</key>  
        <string>0.651 0.886 0.18 1</string>  
        <key>xcode.syntax.identifier.function.system</key>  
        <string>0.4 0.851 0.937 1</string>  
        <key>xcode.syntax.identifier.macro</key>  
        <string>0.992 0.592 0.122 1</string>  
        <key>xcode.syntax.identifier.macro.system</key>  
        <string>0.992 0.592 0.122 1</string>  
        <key>xcode.syntax.identifier.type</key>  
        <string>0.651 0.886 0.18 1</string>  
        <key>xcode.syntax.identifier.type.system</key>  
        <string>0.4 0.851 0.937 1</string>  
        <key>xcode.syntax.identifier.variable</key>  
        <string>0.651 0.886 0.18 1</string>  
        <key>xcode.syntax.identifier.variable.system</key>  
        <string>0.4 0.851 0.937 1</string>  
        <key>xcode.syntax.keyword</key>  
        <string>0.976 0.149 0.447 1</string>  
        <key>xcode.syntax.number</key>  
        <string>0.682 0.506 1 1</string>  
        <key>xcode.syntax.plain</key>  
        <string>0.973 0.973 0.949 1</string>  
        <key>xcode.syntax.preprocessor</key>  
        <string>0.976 0.149 0.447 1</string>  
        <key>xcode.syntax.string</key>  
        <string>0.902 0.859 0.455 1</string>  
        <key>xcode.syntax.url</key>  
        <string>0.459 0.443 0.369 1</string>  
    </dict>  
    <key>DVTSourceTextSyntaxFonts</key>  
    <dict>  
        <key>xcode.syntax.attribute</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.character</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.comment</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.comment.doc</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.comment.doc.keyword</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.class</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.class.system</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.constant</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.constant.system</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.function</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.function.system</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.macro</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.macro.system</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.type</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.type.system</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.variable</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.identifier.variable.system</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.keyword</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.number</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.plain</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.preprocessor</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.string</key>  
        <string>Menlo-Regular - 12.0</string>  
        <key>xcode.syntax.url</key>  
        <string>Menlo-Regular - 12.0</string>  
    </dict>  
</dict>  
</plist>  
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017/11/22 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档