Sublime Text 2:已编辑文件选项卡的颜色? [英] Sublime Text 2 : colour of edited file tab?
问题描述
我看到可以编辑 Sublime Text 主题 (.config/sublime-text-2/Packages/Theme - Default/Default.sublime-theme) 以使打开的选项卡更加明显.
I see that the Sublime Text theme (.config/sublime-text-2/Packages/Theme - Default/Default.sublime-theme) can be edited to make the open tab more obvious.
为此我使用
{
"class": "tab_control", "attributes": ["selected", "file_medium_dark"],
"tint_modifier": [0, 255, 0, 32]
/* ... */
},
使标签更环保.
是否有类似的方法可以为已编辑(未保存)的文件/缓冲区的选项卡着色?
Is there a similar method for colouring the tab of an edited (unsaved) file/buffer?
谢谢.
推荐答案
在和 Mikko 一起寻找更改日志的建议之后:
After a little hunting around together with Mikko's suggestion of looking at the change log:
在设置-用户从首选项打开|设置
在行中添加
In Settings-User opened from Preferences | Settings
add in the line
"highlight_modified_tabs": true,
每当文件有未保存的更改时,这将使选项卡文本变为橙色.
This will make the tab text orange whenever there are unsaved changes to a file.
要从橙色更改颜色,需要进行一些进一步的挖掘和实验,结果表明编辑主题是从橙色更改颜色的一种方法.
To change the color from orange, a bit of further digging around and experimentation was needed and revealed that editing the theme was one way to change the color from orange.
主题文件可以位于从菜单Preferences | 访问的
- 您必须为要更改其文本颜色的每个主题进行这些更改:Color Scheme - Default 文件夹
中.浏览包...
Theme files can be located in in the Color Scheme - Default folder
accessed from the menu Preferences | Browse Packages...
- you will have to make these changes for every theme that you'd like to change the text color for:
{
"class": "tab_control", "attributes": ["selected", "file_medium_dark"],
"tint_modifier": [0, 255, 0, 40],
"layer2.texture": "Theme - Default/medium_dark_selected_tab_bg.png",
"layer2.opacity": 0.7
},
{
"class": "tab_control", "attributes": ["dirty", "file_medium_dark"],
"tint_modifier": [255, 0, 0, 40],
"layer2.texture": "Theme - Default/medium_dark_selected_tab_bg.png",
"layer2.opacity": 0.7
},
{
"class": "tab_control", "attributes": ["selected", "dirty", "file_medium_dark"],
"tint_modifier": [255, 255, 0, 40],
"layer2.texture": "Theme - Default/medium_dark_selected_tab_bg.png",
"layer2.opacity": 0.7
},
最好分别控制selected"和dirty"(=修改)的行为.这可能对层来说是可能的,但我对这些还不够了解.
It would be nice to be control the behavior of "selected" and "dirty" (=modified) separately. That might be possible with the layers, but I don't understand those well enough yet.
附录
(1) 以上是针对深色主题的.对于浅色主题,请省略属性中的 "file_medium_dark"
.
(1) The above is for dark themes. For a light theme, omit the "file_medium_dark"
from the attributes.
(2) 相同的更改似乎适用于 Sublime Text 3 (~/.config/sublime-text-3/Packages/Default.sublime-theme).
(2) The same changes apear to work in Sublime Text 3 (~/.config/sublime-text-3/Packages/Default.sublime-theme).
这篇关于Sublime Text 2:已编辑文件选项卡的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!