本文介绍了如何刷新 Sublime Text 3 工作区配色方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你保存一个项目时,Sublime Text 会创建一个 .sublime-workspace 文件.在这个文件中,有一个缓冲区数组,每个缓冲区都有一个 color_scheme 属性.这被设置为创建缓冲区和工作区时选择的任何配色方案.

When you save a project, Sublime Text will create a .sublime-workspace file. In this file, there is an array of buffers, and for each buffer there is a color_scheme property. This is set to whatever color scheme was chosen when the buffers and workspace were created.

我最近在用户设置文件中更改了主题和配色方案.如何刷新我的项目的所有工作区,以便它使用我的用户首选项文件中提供的新 color_scheme,而无需逐一编辑每个项目的工作区文件?

I recently changed my theme and color scheme in my user settings file. How can I refresh all of my project's workspaces so that way it uses my new color_scheme provided in my user preference file without needed to edit each project's workspace file one-by-one?

推荐答案

扩展 Tot 给出的答案,您可以对使用嵌套列表理解打开的所有窗口中的所有视图执行此操作(请记住这是 Python,因此我们可以很灵活):

Expanding on the answer given by Tot you can do this for all views in all windows that are open by using a nested list comprehension (remember this is Python so we can be pretty flexible):

[ v.settings().erase("color_scheme") for views in [ w.views() for w in sublime.windows() ] for v in views ]

这样您就不必在每个选项卡中单独运行命令.

This way you don't have to run the command in each tab individually.

这篇关于如何刷新 Sublime Text 3 工作区配色方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 10:50