我依然爱iOS

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

2017-11-22  本文已影响15人  Cloudox_

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>  

查看作者首页

上一篇下一篇

猜你喜欢

热点阅读