I have been using sublime for about half and year and now i want to make some modifies to it. I installed few packages and rest of stuff but i have a kind of problem.
Using theme Monokai ( and also in other tested themes ), i can't give the right color to attributes like "-webkit-box-shadow" and other css3 elements. I mean, i would like to have the right color also for vendor prefixes and new css3 elements.
Add this <dict> entry to your .tmTheme file to have the right colors for all (also unknown) css property names:
<dict>
<key>name</key>
<string>CSS property name</string>
<key>scope</key>
<string>meta.property-name.css</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string>italic</string>
<key>foreground</key>
<string>#66D9EF</string>
</dict>
</dict>
I found a plugin that solves my problem https://github.com/i-akhmadullin/Sublime-CSS . Closed !
Related
For Sublime themes, how can I, or can I customize my theme for colors of a single/double quote within a double/single quote, respectively?
So for example, this "quote might be blue where 'this is green'".
Currently using Sublime Text 2 with a slight variation from the Railscast theme.
This is the code snippet from the theme that I suspect I need to modify, somehow?
<dict>
<key>name</key>
<string>String</string>
<key>scope</key>
<string>string</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#A6E22E</string>
</dict>
</dict>
Try the following:
<dict>
<key>name</key>
<string>Double-Quoted String</string>
<key>scope</key>
<string>string.quoted.double</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#0000FF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Single-Quoted String</string>
<key>scope</key>
<string>string.quoted.single</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#00FF00</string>
</dict>
</dict>
This won't work for every language, as not all language definitions differentiate between single- and double-quoted strings, but for those that do (like HTML and PHP, for example) you should now have double-quoted strings in blue and single-quoted ones in green. Of course, feel free to play around with the colors' hex values.
Is there a way I can highlight just tab characters? I know about "draw_white_space": "all" but I don't want to highlight all whitespace, just tabs.
There doesn't seem to be a plugin or a setting that fits the bill. I'd like to avoid writing a new plugin, but I will if I have to.
Thanks in advance!
I haven't worked on this plugin in a while, but you can try PersistentRegexHighlight. You will just need to define a regex pattern for the tabs and a color to highlight with if you don't like the default.
I have only tested this on SublimeText2. As an alternative to PersistentRegexHighlight, you could use the following minor modifications to the theme and language files. Please feel free to disregard / remove the whitespace definitions -- I included them because someone else may be interested in seeing how to modify Theme / Language files:
Excerpt from whatever language syntax you want -- e.g., LaTeX.tmLanguage
<!-- BEGIN whitespace / tab definitions -->
<dict>
<key>match</key>
<string>\t+</string>
<key>name</key>
<string>lawlist.tab</string>
</dict>
<dict>
<key>match</key>
<string> +</string>
<key>name</key>
<string>lawlist.space</string>
</dict>
<!-- END -->
Excerpt from whatever theme you are using -- e.g., lawlist.tmTheme
<!-- BEGIN whitespace / tab definitions -->
<dict>
<key>scope</key>
<string>lawlist.tab</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF0000</string>
<key>background</key>
<string>#FFFFFF</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>lawlist.space</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#000000</string>
<key>background</key>
<string>#FFFFFF</string>
</dict>
</dict>
<!-- END whitespace / tab definitions -->
I am looking for a way to change the appearance of the whitespace grey dot to something bigger and darker (without changing the background color) -- similar to UltraEdit (see screenshot).
I've read all the popular threads on the issue, and I've tried all the popular modifications (e.g., plugins, and/or changing the language and theme files), but I haven't found a way to darken the grey dot or make it any bigger.
I've already experimented with everything mentioned in this related thread, including the links set forth therein: Sublime Text 2: how to change white space characters color?
(source: lawlist.com)
.tmTheme
<!-- BEGIN whitespace / tab definitions -->
<dict>
<key>scope</key>
<string>lawlist.tab</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#FF0000</string>
<key>background</key>
<string>#FFFFFF</string>
</dict>
</dict>
<dict>
<key>scope</key>
<string>lawlist.space</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#000000</string>
<key>background</key>
<string>#FFFFFF</string>
</dict>
</dict>
<!-- END whitespace / tab definitions -->
.tmLanguage
<!-- BEGIN whitespace / tab definitions -->
<dict>
<key>match</key>
<string>\t+</string>
<key>name</key>
<string>lawlist.tab</string>
</dict>
<dict>
<key>match</key>
<string> +</string>
<key>name</key>
<string>lawlist.space</string>
</dict>
<!-- END -->
Someone bumped a post on the ST forum about coloring white space and I thought of this post. You may see it too, but just in case, I'll post here. Basically they modified the tmLanguage file to give a new scope to leading whitespace. They then applied a color to that.
https://github.com/ckovey/sublime-whitespace-coloring
There is no solution to this issue.
I am having a problem with the syntax highlighting for HTML (and plaintext) in Sublime Text 2,
as it only grays out the lines as in the image.
Whenever I shift to Python, JavaScript, and other languages, the highlighting works fine.
I am new to Sublime Text 2, so it is probably an easy answer, but I did not know how to formulate the issue without showing an image.
I dont't think it is a problem, it's just how the theme "All Hallow's Eve" works:
You can change the this color inside this block: (Preferences->Browse Packages>Color Scheme - Default->All Hallow's Eve)
<dict>
<key>name</key>
<string>Text base</string>
<key>scope</key>
<string>text</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#434242</string> #THIS IS GRAY COLOR YOU WANNA CHANGE.
<key>foreground</key>
<string>#FFFFFF</string>
</dict>
</dict>
I found the problem; it seems like the color scheme "All Hallow's Eve" is not
working very well on HTML, so I simply changed the color scheme.
In some themes in sublime text, the background colour of the area within certain tags like script or php is of a different colour from the rest of the code. For example like that in the iPlastic or twilight theme.
For Example: http://imageshack.us/photo/my-images/541/screenshot20130207at342.png/
I hope to achieve the same effect in the Tomorrow colour scheme which does not have this by default. I understand that i have to edit the .tmTheme file, but I am not sure of the code I am supposed to put in.
Any help would be much appreciated.
Thanks!
You should add something like this to your .tmTheme file:
<dict>
<key>name</key>
<string>Embedded source</string>
<key>scope</key>
<string>text source</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FCFCFC</string>
</dict>
</dict>
Of course you can set the colors that you prefer.
Open with Sublime the .tmTheme file you want to edit, and first of all save it with a different name (but with the same extension). Then look for this:
<string>text source</string>
This is present only in some of the .tmTheme files! In the file iPlastic.tmTheme file you mentioned, you will find it in this entry:
<dict>
<key>name</key>
<string>Embedded source</string>
<key>scope</key>
<string>text source</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FAFAFAFC</string>
<key>foreground</key>
<string>#000000</string>
</dict>
</dict>
If .tmTheme files were written in JSON instead of this clumsy XML, the entry would look like this:
{
"name": "Embedded source",
"scope": "text source",
"settings": {
"background": "#FAFAFAFC",
"foreground": "#000000"
}
},
In this case the background value is almost white (0xFA in all three channels), but a tiny bit transparent (0xFC opacity). The result depends on the background value you find towards the start of the file, which in this case is #EEEEEEEB (notice the absence of name and scope):
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#EEEEEEEB</string>
The 0xEB opacity, as far as I can tell, is ignored here, since the default background is #EE. #FA with 0xFC opacity gets composited over #EE as #F9 (which makes sense).
Now, if you want to force the background of the text source scope to some value, you have to change its <dict> entry if it's present, and add it if it's not.
If, on the other hand, you want to make the background of the text source scope equal to all the rest, what you have to do is simply to delete its <dict> entry.
Remember that a 3-byte value like #AABBCC is 100% opaque, i.e., it has 0xFF opacity, i.e., it is equivalent to the 4-byte value #AABBCCFF.
Keep also in mind that you may put the modified .tmTheme file underneath, e.g., the PHP subdirectory of Packages, instead of the Color Scheme - Default subdirectory. This is particularly useful for PHP, where the default background is the one outside of <?php...?>, while the one inside is the one of the text source scope (this is an artifact of the trick used in order to inherit the settings for the HTML file type). Unless your PHP files contain lots of HTML (or whatever you have outside <?php...?>), you might want to put underneath PHP a theme with a background value for text source equal to the default background value for other file types, and a different default background value just for PHP files.