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

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

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

image

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

image

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

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

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

主题内容:

<?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>  

查看作者首页

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,881评论 18 139
  • 1. 新建项目并进入目录 2.创建一个简单的页面 3.启动 4.准备本地化文件 下载地址:zh-CN.yml放到b...
    ahtest阅读 1,371评论 0 3
  • 云破天开出日轮,万水千山沐朝晖。 满室光明锁不住,化作金缕自在飞。 2013年7月
    心梦天涯阅读 209评论 0 1
  • 大家好,很高兴有机会和大家分享有关RIE课程的相关点滴。 一、我为什么探索幼儿教育? 我们越去了解孩子,越会有大量...
    邹龙在路上阅读 369评论 0 0
  • 本篇内容整理自冯蕊分享内容《1小时写作入门,零基础也可以成为码字高手》,结合个人理解而成,如有不同建议,欢迎留言交...
    小马哥S阅读 667评论 4 14