How to recover color palette in Sublime Text 3 - sublimetext3

Something strange happened to me recently. I was testing the color schemes of Sublime Text 3 by selecting them from the menu Sublime Text > Preferences > Color Scheme. I did not find any that I liked more than my current one, but then I realized that the one I was using was not among the color schemes listed. Unfortunately I do not remember the name of the color scheme I was using.
By searching for popular color schemes online, I found one that is close: "Afterglow-twilight". However, the scheme I was using had much higher contrast, i.e. darker background and more vivid code highlight colors.
Is there a way in Sublime Text 3 to recover the color scheme I was using?

The color scheme that you're using is set as the color_scheme setting in your user preferences and the menu item Preferences > Color Scheme (which is under Sublime Text if you're on MacOS) allows you to more easily set that preference by showing you a list of all all most available color schemes along with letting you preview what they look like.
The short answer to your question is No, but the longer answer to your question is Yes.
The No is because unless you have your Preferences.sublime-settings file backed up somewhere (say if you use Dropbox to sync it) or under version control of some sort, then the value of the setting is gone now and the only way to get it back is to figure out what color scheme you were using so that you can reset it.
The Yes is because Sublime will only allow you to use color schemes that you have installed locally, and using the menu item outlined above allows you to pick between those you have installed (changing the setting as appropriate) but it doesn't remove any installed color schemes.
That means that unless you uninstalled a package in between when you were playing and noticed that your color scheme is no longer listed, that color scheme is still present even if the list isn't displaying it (and if you did uninstall a package, re-installing the package will bring it back). So all you need to do is figure out what it was.
There's a strikethrough in the first paragraph because Sublime hides some color schemes from you, so if you were using one of those it won't appear in the list and you need other means to find it.
The first thing to try is to add the following setting to your user settings (if it's not already there) to tell Sublime that legacy color schemes should also be listed:
"show_legacy_color_schemes": true,
Around the time the menu item for changing color schemes was added to the interface, some of the color schemes that used to ship with Sublime were relegated to Legacy status because they were wildly out of date and either not popular enough to warrant work to update them or impossible to fix without making visual changes.
Those color schemes are still present, but they're masked from the list of displayed color schemes unless you turn that setting on. So, in the case that you happened to be using one of those previously, this setting should let you find it again. Syntaxes that fall into this category will say Color Scheme - Legacy under them in the list.
If that doesn't turn up the color scheme that you were using, there is one last avenue of exploration. Sublime supports the idea of a hidden color scheme, which is generally something used by packages to give color schemes to things without more generally exposing them. Possibly there is a Theme out there for Sublime that distributes it's color schemes this way as well.
If you open the Sublime console with View > Show Console, you can enter the following lines one at a time into the input at the bottom of the window:
sublime.find_resources("*.hidden-tmTheme")
sublime.find_resources("*.hidden-color-scheme")
This will get Sublime to show you a list of all of the hidden color schemes (there are two different formats). Assuming either list is not empty, the items in the list represent hidden color schemes that the command mentioned above doesn't display.
If so, you can open your user preferences and manually set the color_scheme setting to each of the items in turn to see if one of them is the one you're looking for.

Related

Settings type «invisibles» and «shadow» in Sublime Text 3 .tmTheme file

I have read the documentation for the Color Schemes. I realized all settings except invisibles and shadow (+shadowWidth). I can translate from English, but I do not see anywhere where the elements, the color of which changes settings. Does anyone could show me the screenshots, where there are elements which change color? Thanks.
From the unofficial documentation on color schemes, linked to in your question, we can see that invisibles is ignored, so changing it has no effect on the appearance of any elements in ST3. The tmTheme format is borrowed from a different text editor, to make it easier to use the same color scheme in different editors. So maybe it does something in other text editors, but not in ST. EDIT: support for invisibles has been added to ST in build 3149 - https://github.com/SublimeTextIssues/Core/issues/1992.
The effect of the shadow setting can be seen below, it is the pink parts on the far sides:
It is only visible when the text in the document is wider than the window - it will appear on the left when the view can be scrolled to the left and it will appear on the right when the view can be scrolled to the right.
From my testing, including shadowWidth in the tmTheme file will cause the shadow to not appear. I have logged an issue in the unofficial documentation here, maybe someone will update it with details of how to get this working.
Note:
When making changes to atmTheme file, it is often necessary to close all open documents, and restart Sublime Text, before the change will become visible.

Pure black background in PyCharm CE and Android Studio

While my search for a Python debugger on Emacs remains unfulfilled, I am giving PyCharm CE a test drive.
Already on my second day I'm encountering a trivial but frustrating point. Is it possible to set the background to be pitch black in just one place?
A program written by programmers for programmers should certainly have included a feature such as "change the background for Docstrings, Comments, Keywords, ... the whole shebang" to black, but I don't see it.
I understand of course that some parts of the UI will stubbornly refuse to change, and I'm OK with that, just so long as the Python code itself appears on a pure black background.
The Twilight and Mokokai themes come close, but their backgrounds still leave ample "contrast room" that could be used by darkening the background color.
(How do we get from left to right... err.. I mean.. how do we get darker than we are.. um, wait... Isn't the version on the right so much easier on the eye.. but anyway, how can we do it?)
Update
The exact same problem and solution apply to Android Studio.
In File > Settings:
Go to Editor > Colors & Fonts > General
Choose the theme you want to modify (will likely need to Save As... your own as you can't modify the default color schemes.
Go to the Text > Default Text colors and change the background to black. The only ones that won't be affected are the syntax highlighters that define their own background (usually select/highlight/errors/etc.)

Paypal code's color scheme

Is there a method to extract the code's color scheme from paypal code expamples and place it in sublime text?
Here is a link: Paypal link
That page is made using Groc, that put comments next to code in a beautiful way. Groc seems to use two projects that I have used before: highlight.js and maybe pygments, to highlight the code, but they don't use any of the default stylesheets, I think they use their own stylesheet.
Inside the Groc project you can see this sass file which contains almost all the info you need (color for variables, strings, keywords, etc.) to manually add the values to a custom color scheme. In addition Groc style documentation shows other useful values of the Color Scheme such as the background. You can get other values inspecting DOM.
I think you would have to manually do it. You can use this Sublime Text Color Scheme Generator. In the Paypal window, you can use developer tools (Ctrl + Shift + C if you're using Chrome) and click on the words to see the exact color value, and then just use those in the color scheme generator.
EDIT: Please take a look at #sergioFC's answer, he gave an easier way of finding all the color values.

How to change the font style for Rust primitive types in SublimeText 3?

Right now types like i32 etc. are being shown as Italics.
I wish to avoid that, but the only Rust preferences I see are in compiled form in ~/Library!
You will need to edit your color scheme to change the syntax highlighting. Look for the scope storage or storage.type and remove the italic setting. This resource is great for editing color schemes. If you're using Monokai, it comes up automatically. If not, click the Gallery button and select the color scheme you're using.

Theme default Colors FG and BG for both editing and compare makes elements never seen

I am quite newbie.
After I have installed Studio3 plugin Eclipse, I got some problems of colors with Default Theme.
In these for the moment I have a not workaround situation while using the "Text compare" because I could not find how two change the color of elements which have the same color as background "black".
When black background is used, as the comparison mode uses black as default color for many elements they are hidden. I made some test with a variant grey background to find the elements, it obviously can't be used for normal use.
Where are the template definition for "comparison mode" seems the main question ?
The minimum to reach is that the black ForeGround colored elements (defined surely for white background) become white with a black background.
Elements of analysis :
The changes on other elements are taken in account in comparison mode (and obviously in edit mode which functions normally), but the elements that are not taken in account in comparison mode are black by default. So I look at a default color for not held elements, I could not find such an item. The default values that I found, and that I declared FG white, have no effect.
Thanks for help.
Trebly
Aptana Studio 3.0.7
No changes done to default parameters
context : Php
black elements in compare mode : vars; functions calls; names; syntax base;
hold elements : text; keywords (var, function, parent, class, extends, array, empty....); comments
After quite long search :
When Aptana studio3 plugin is installed, the default theme can not be well setup for others editors than Aptana such as standard comparison if you use the Aptana studio3 theme. Then you get incoherent display. The solution is simple.
To get everything right, if the application is able to hold new Aptana theme management, you must simply :
1- change the default Aptana studio3 theme for example for ECLIPSE (Base) theme
2- Change again to Aptana studio3 theme, this will reset all elements of themes (for various compatible editors)
Note : SmartyPDT (and others not tested probably) are not compatible with the theme management of Sudio3, in such case you need to stay with another theme as Studio2 (theme option in studio3). In fact the defined colors are compatible with studio2, particularly black standard text (which was default color). The incompatibility makes that you get a not a coherent fit of colors which lead to incoherency, which can't be avoided, worse black on black... for some text-elements.
Trebly

Resources