如何编辑Sublime Text 3的Soda主题

18

我在Mac上安装了Sublime Text 3的Soda主题,但不知道主题的实际文件和文件夹在哪里,这样我就可以查看主题文件并进行编辑,同时我也想调整一些主题中使用的图片。

根据Git文档,如果您要手动安装Soda到Sublime,则需将soda文件夹放入软件包目录,但是当我通过控制包安装Soda时,我没有看到Soda主题在软件包目录中。

3个回答

37
除非明确指定不使用它,否则大多数适用于Sublime Text 3的包都使用.sublime-package格式(基本上是一个zip文件)。这些包存储在Installed Packages文件夹中,与Packages文件夹并列。如果你想使用它们,我强烈建议安装由@skuroda提供的PackageResourceViewer插件。通过Package Control进行安装。

安装完成后,使用P打开命令面板,输入prv以获取PackageResourceViewer选项。选择Extract Package,导航到Theme - Soda,按Enter,然后您可以开始了——Packages/Theme - Soda目录现在应该已经存在,并包含Github repo中的所有文件。现在你可能最感兴趣的是.sublime-theme文件。

愉快地玩耍吧!


那么,你如何切换到使用已安装的主题?即使重新启动了Sublime,我也没有在任何偏好设置菜单中看到它。 - Wilson F
5
大多数主题的文档中都包含了激活它的说明。对于Soda主题,有两组选项 - 暗色和亮色,以及Sublime 2和3。所以,在ST3上使用暗色主题,主题名称是Soda Dark 3.sublime-theme。ST2也是一样,名称为Soda Dark.sublime-theme。在用户首选项中,设置"theme": "themename.sublime-theme",例如"theme": "Soda Dark 3.sublime-theme"。保存用户首选项,重新启动Sublime,新主题将被激活。 - MattDMo
谢谢!当我在浏览代码库时,不知怎么的,完全忽略了 README 文件的存在。真是笨啊。 - Wilson F

1
这个答案类似于被接受的解决方案,但如果它不能直接使用,需要多些步骤。如果有人遇到我在下面其中一个步骤中描述的问题,这可能会对他们有所帮助。请保留HTML标签。
  1. install PackageResourceViewer using Package Control

  2. Go to Preferences->Package Settings->PackageResourceViewer->Setting-User. copy paste the following 3 lines,save and close it.

    {
    "single_command": false
    }
    
  3. press Ctrl+shift+p to open Package Control and select PackageResourceViewer: Edit Package Resource from the list. Find the package you want to edit and click on it. In my case, I want to edit a theme which is installed via ColorSublime Package, So I selected that theme.

  4. Now you will see that the selected package file opened in the sublime editor itself. Edit it as you want and save it and close it. The changes should reflect in sublime editor. In my case, since I changed the theme I need reload it. So I continued with the following steps too.
  5. go to view menu select 'Show Console' and run following command to reset the theme.

    view.settings().erase("color_scheme")
    
  6. open Preferences->Settings and delete the "color_scheme" attribute and its value from the settings file and close it. Again select the color theme from Preferences->Color scheme. Now you should able to see the changes reflected which you made in the theme package.

希望这有所帮助!

0

你可以按照以下步骤进行操作。

  1. Sublime Text 2~/Library/Application Support/Sublime Text 2/Packages/Color Scheme - Default文件夹中提取Soda主题
  2. 在Sublime Text 3中,选择Sublime Text / Preferences / Browse Packages ...
  3. 在与Users文件夹相邻的位置创建一个名为THEMES的文件夹
  4. 将所有你想要的主题(包括Soda主题或其他任何主题)从文件夹~/Library/Application Support/Sublime Text 2/Packages/Color Scheme - Default中放入到Sublime Text 3的~/Library/Application Support/Sublime Text 3/Packages/THEMES文件夹。
  5. 编辑你想要使用的主题的XML。
  6. 回到Sublime Text 3,在菜单中选择Sublime Text / Color Schemes / THEMES / YourTheme.tmTheme来使用它。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接