Can Google Cloud Shell Editor (Theia) have color themes configured per workspace? - theia

I like having a color theme configured per workspace in VS Code to give me an immediate indication of the project. I cannot seem to find a way to do this in the Cloud Shell Editor, Theia. The option to set the Color Theme appears to be global; is this possible at all to set per workspace? How?

Yes Google Cloud Shell Editor (Theia) can have color themes configured per workspace.
Steps :
Go to Cloud Shell Editor.File -> Open Workspace.
Choose a workspace/ folder you want to test on.
After the workspace is opened,File-> Settings -> Open Preferences.
There are two tabs, User and Workspace.
User Settings : Globally-applicable settings, applied to all your instances of the Cloud Shell Editor.
Workspace settings : Workspace-specific settings, applied to only the currently active workspace. These settings are saved in the .theia/settings.json file in your workspace folder and can be shared using version control or by downloading the workspace folder.
Switch to Workspace settings by clicking on the Workspace tab.
Use the Search Settings search bar that returns a set of settings
that match your query. Type color theme in the search bar.
You will see the query returns, Workbench: Color Theme (which
specifies the color theme used in the workbench)
Type any theme you want : Red/ light/ light+/Abyss/ Dark/ Dark+/
Solarized Dark/Tomorrow Night Blue etc. and then press Enter. Your
workspace is configured with the theme you chose.
Now to be sure, open any other workspace, you won’t see the theme
that you set in your previous workspace appearing in your current
workspace. By default any workspace has theme Light (Theia)

Related

Can I set a workspace settings in user settings in vs code?

I know there are two places you can configure settings in VS code. User settings and workspace settings.
Our team occupy the workspace settings already and we maintain it in git for everyone for a project.
So I can't have my specific change there for a project. What I'm trying to do is using different theme for each project. Is there any way to do so? I hope there is a "third" settings only for me for a specific workspace.
Constantly unstaging my change is not an option :)
You can put all projects in a Multi Root Workspace (.code-workspace file)
Then you can use the extension When File to change the theme based on file paths. It will change the settings in the .code-workspace file

Prevent the Workspace default settings from overriding the manually entered User settings in VS Code

How could I use User settings inside VS Code if there are always Workspace settings?
I am working with a project directory. I am working using VS Code, but other team members use different IDEs to work with the directory. So, we are not allowed to add any IDE specific folders (e.g. the .vscode folder). That means in reality the project has no VS Code Workspace settings. But whenever I go to the Settings I still can see that Workspace tab.
I tried to update the prettier.tabWidth property in User to be 4, while in Workspace it is 2 and still VS Code uses the value from Workspace even though there are no Workspace files and the value is merely default. And I can not change the Workspace settings, since then the Workspace settings file will get added to the project.
So, basically the default Workspace settings override the manually put User settings. That is depressing actually since it makes User settings useless.
E.g. is there any way for me to set the prettier.tabWidth to 4 without adding Workspace settings files to the project?

.vscode/settings.json is empty but plugins are disabled in workspace

I want to disable several plugins in certain workspace in VS code. So I've started vs inside workspace, opened plugins tab and clicked arrow next to disable button and choose Disable (workspace). And it works. Now when I open certain workspace I have disabled plugins which I've disabled before. But where does VS code store the information about disabled plugins in workspace? In my workspace where I've disabled plugin I have .vscode/settings.json but this file is empty (same result if I do: File > preferences > settings choose Workspace and click Open Settings (top right)). Re-enabling plugins in workspace also works as expected.

No workspace settings in VSCode json settings editor

I created a VSCode workspace
I then saved it as golang.code-workspace file (say) on my Desktop
When double clicking the file, VSCode opens with the expected files on the explorer sidebar.
I now want to edit the particular Workspace's settings, so I hit Command + , on my keyboard.
I am then presented with the following json file(s)
What troubles me is that according to the breadcrump (Users > pantelis > Library > Application Support > Code > User {} settings.json), it seems as if are some kind of global, and not workspace-specific settings.
How can I edit the settings for just the particular workspace I created?
In the UI, the distinction is more clear as you can see in the image below.
Also, in the UI, why do I get (apart from the User settings tab), 2 additional tabs (Workspace and the name of the workspace (golang) I just created?) what is the difference between these two?
There's the command "Preferences: Open Workspace Settings (JSON)" (workbench.action.openWorkspaceSettingsFile) which opens the workspace-specific settings (optionally creating the file ./.vscode/settings.json relative to the workspace root if it doesn't exist yet). The order in which settings are overridden is as follows (from more important to less important):
Workspace settings
Global settings
Default settings
... i.e. if you have a certain setting in your workspace settings, it will override the same setting in your global settings; in the same manner your global settings override the defaults (and the defaults are just what VSCode ships with and what's in force if you don't change anything).

How to change the *default* default encoding in Eclipse?

Every time a new workspace is created, Eclipse defaults to Cp1250 encoding.
Whenever I create a new branch of the project, and as result switch to a new workspace in Eclipse, I need to go to Window -> Preferences -> General -> Workspace : Text file encoding and manually switch to "Other: UTF-8". If I forget this step, Eclipse mangles the UTF-8 characters in the project files.
Can I change the default somehow, permanently, so that all new workspaces start as UTF-8 without need to switch them manually?
Actually, it is quite simple:
Create a defaults.ini file in the Eclipse configuration folder. For example, if Eclipse is installed in C:/Eclipse create C:/Eclipse/configuration/defaults.ini. The file should contain:
org.eclipse.core.resources/encoding=UTF-8
If you want to set the line terminator to UNIX values you can also add:
org.eclipse.core.runtime/line.separator=\n
In eclipse.ini in the Eclipse install folder (e.g., C:/Eclipse) add the following lines:
-plugincustomization
D:/Java/Eclipse/configuration/defaults.ini
You might need to play around with where you put it. Inserting it before the "-product" option seemed to work.
This appears to be determined by this code in org.eclipse.ui.WorkbenchEncoding:
/**
* Get the default encoding from the virtual machine.
*/
public static String getWorkbenchDefaultEncoding() {
return System.getProperty("file.encoding", "UTF-8");
}
So it is taken from the 'file.encoding' environment variable, defaulting to 'UTF-8' if that is not set.
This is one of the key things that Eclipse Oomph was created to solve, the ability to set default default preferences, i.e. preferences set across workspaces.
You can go "whole hog" and adopt using Oomph as a full Eclipse Installer and share the install scripts between your team members. The installer can configure everything from which plug-ins to install, to default preference values, to where to check code out from.
Preference Recorder
However, for now you can simply use the Preference Recorder.
Install Oomph, it is possibly already installed if you are using Eclipse Mars. If not, from the Mars update site you can install "Oomph Preference Management"
Open the preferences page, you should now have a new icon next to Help in the bottom left. It will allow you to turn on/off the preference recorder:
With the recorder on, change your preferences you want, in this case your encoding, then press OK. You will then be asked if you want to track the changed preferences across your workspaces. You can change the values in the User Policy column.
Now if you create a new workspace, those tracked preferences will be applied to the new workspace.
If you want to see what is being recorded, in Preferences, see Oomph -> Setup Tasks -> Preference Recorder
To access the full setup configuration, press the button to the right of the Record Into drop-down (top right of UI) and the setup file will be opened in the editor, where you can do further control and mods:
PS. the default default of the encoding is a hotly contested issue at Eclipse, hopefully the default default will change to UTF-8 everywhere.
in eclipse.ini add :
-Dfile.encoding=UTF-8