In VSCode, is there a way to hide the top action menu bar that appears in the tabs row? I rarely use it and I find that it crowds the already limited space available to browse through open tabs. Moreover, its presentation is also inconsistent, especially when split panes are activated.
I'm not sure if I am referring to this VSCode functionality properly, so here's a screenshot demonstrating what I'm talking about (file names had to be blurred out due to NDA reasons):
Thank you.
Update 2022-09-28
An issue to address this feature has been completed and it will arrive with the next release. It is already available on the Insiders version.
This closed issue references another feature request different from the original one referenced on this answer.
Context
It is called editor actions and, within the standard/native VSCode settings, you cannot hide it.
A setting to hide this annoying bar is an open issue at VScode's GitHub since March 2018.
Fixes
Removing the whole bar
I feel your pain. This worked for me:
Install the Customize UI extension.
Open your user settings JSON:
cmd + shift + P / ctrl + shift + P
Add this setting:
"customizeUI.stylesheet": {
".editor-actions": "display: none !important;",
},
It is gone!
Removing specific icons, by position
The foremost left icon is the number 1.
Example in plain CSS:
.menu-item-action-item-icon-1,
.menu-item-action-item-icon-3 {
display: none !important;
}
Example using Customize UI extension:
"customizeUI.stylesheet": {
".menu-item-action-item-icon-1": "display: none !important;",
".menu-item-action-item-icon-3": "display: none !important;",
},
Removing just Gitlens icons
Gitlens icons can be hidden within Gitlens' settings:
"gitlens.menus": {
"editorGroup": {
"blame": false,
"compare": false
},
},
I came up with a slightly different approach: instead of hiding the buttons, move them down one level to the breadcrumb bar:
This is done using the Customize UI extension with the following configuration:
"customizeUI.stylesheet": {
".tabs-and-actions-container": {
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions": {
"position": "absolute",
"top": "100%",
"right": "0px",
"height": "22px !important",
"z-index": "1",
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions .action-item": {
"margin-right": "3px !important",
},
".tabs-and-actions-container .editor-actions .action-item a": {
"font-size": "13px",
},
".tabs-and-actions-container .editor-actions .action-item .codicon": {
"width": "13px",
"height": "13px",
},
".tabs-and-actions-container .tab:last-child": {
"margin-right": "0 !important",
},
".title.tabs.show-file-icons": {
"overflow": "unset !important",
},
}
This solution is theme-independent, so it should work for all colour combinations. The background color for the buttons is always the same as the background color of the tab bar. If you use only one static theme, you could hard-code the background-color for the .tabs-and-actions-container .editor-actions selector to the exact color of the breadcrumb bar for a more seamless design. However, this does not work when switching themes.
The only drawback to this solution is that the buttons overflow the rightmost breadcrumb information, but I'm fine with that. At least the tab bar does not resize anymore, while I still have those buttons.
Hi there 👋🏼 I removed the GitLens plugin and it disappeared
For anyone using Customize UI and not getting the icons to disappear after targeting ".editor-actions", I was able to get the action icons to disappear by selecting ".monaco-toolbar":
"customizeUI.stylesheet": {
".monaco-toolbar": "display: none !important"
}
Related
I have these settings applied in the theme file for an extension I use:
"font-family": "Arial",
"colors": {
"activityBar.background": "#ffffff",
"activityBar.foreground": "#000000",
"activityBar.activeBorder": "#615386",
"activityBar.activeBackground": "#ff00ff",
"activityBar.activeForeground": "#ffffff",
"activityBarBadge.background": "#615386"
}
Everything is working fine apart from three values for active element of the ActivityBar. I don't understand what's wrong.. I am able to change the values for my own theme I use on a daily basis (it's based on Egoist One) using the same settings:
"workbench.colorCustomizations": {
"activityBar.activeBorder": "#ffc600",
"activityBar.activeBackground":"#3a414f",
}
I did not find any documentation that would say that these settings can't be modified in the theme file of an extension. Does anybody know why it's not working?
I'm fully able to move my TreeView from the SideBar to the bottom panel (Problems, output, terminal...).
However, I'm uncertain how I would go about making my TreeView appear in the bottom panel by default. The documentation doesn't state anything about the bottom panel.
Any ideas?
I see the panel as an option for the viewContainer as in:
"contributes": {
"viewsContainers": {
"panel" : [ // instead of activityBar here
{
"id": "your virewContainer id",
"title": "your title",
"icon": "$(....)"
}
]
}
}
Found by using intellisense.
I'm a big fan of VScode's minimalist approach, but one thing is bugging me. I would like to hide editor-tab icons.
The icons are from extensions: git-lens & hexdump for VScode. Also the split-editor icon would be nice to hide.
Extension Custom CSS and JS Loader
.tabs-and-actions-container .editor-actions {
display: none !important;
}
Optionally, show them on hover:
.tabs-and-actions-container:hover .editor-actions {
display: flex !important;
}
I faced the same problem and Alex's answer helped me a lot (showing the icons on hover only).
But I still had an issue, especially when coding in a small window:
Let's say I want to open the file "styles.css" using the tabs bar:
As soon as my mouse enters the tabs zone, the menu shows up (because of the hover trick) and I can't click my tab because it's below the icons:
So I came up with this idea:
Showing the icons bar below the tabs (not over the tabs) when hovering
Here is the result:
Here is how I did it:
.tabs-and-actions-container .editor-actions {
display: none !important;
position: absolute;
top: 35px;
right: 0;
z-index: 1;
background-color: #2D2D2D;
}
.tabs-and-actions-container:hover .editor-actions {
display: flex !important;
}
.title.tabs.show-file-icons {
overflow: unset !important;
}
I combined the answers of Vincent and mozlingyu to another solution: instead of hiding the buttons, move them down one level to the breadcrumb bar:
This is done using the Customize UI extension (Warning 2023: it may break your VS Code installation) with the following configuration:
"customizeUI.stylesheet": {
".tabs-and-actions-container": {
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions": {
"position": "absolute",
"top": "100%",
"right": "0px",
"height": "22px !important",
"z-index": "1",
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions .action-item": {
"margin-right": "3px !important",
},
".tabs-and-actions-container .editor-actions .action-item a": {
"font-size": "13px",
},
".tabs-and-actions-container .editor-actions .action-item .codicon": {
"width": "13px",
"height": "13px",
},
".tabs-and-actions-container .tab:last-child": {
"margin-right": "0 !important",
},
".title.tabs.show-file-icons": {
"overflow": "unset !important",
},
}
This solution is theme-independent, so it should work for all colour combinations. The background color for the buttons is always the same as the background color of the tab bar. If you use only one static theme, you could hard-code the background-color for the .tabs-and-actions-container .editor-actions selector to the exact color of the breadcrumb bar for a more seamless design. However, this does not work when switching themes.
The only drawback to this solution is that the buttons overflow the rightmost breadcrumb information, but I'm fine with that.
Without extensions
Open default css file that vs-code reads to render its window
cd /usr/share/code/resources/app/out/vs/workbench
sudo vim workbench.desktop.main.css # or whatever editors but vs-code
Add this line at the end and save it
.editor-actions { display: none }
To identify class names of elements,
just press ctrl + shift p and type toggel developer tools
Here is a better extension for this.
Customize UI
Gitlens icons can be disabled within the extension settings:
https://github.com/eamodio/vscode-gitlens/issues/669#issuecomment-540975432
In Insiders v1.72 now is the ability to hide/show any of the icons on that toolbar, see /hide menuItems.
Building on #teraoka's answer, you might like to keep a script to do this since the setting will revert each time VSCode updates itself
Using a Git-bash / cygwin:
#!/bin/bash
cd /c/Users/noel/appdata/local/Programs/Microsoft\ VS\ Code/resources/app/out/vs/workbench/
cp workbench.desktop.main.css workbench.desktop.main.css.`date +%Y%m%d%H%M`
echo ".editor-actions { display: none }" >> workbench.desktop.main.css
Per the October release of VS Code, the border and background of the Activity Bar's active element can now be controlled via activityBar.activeBorder and activityBar.activeBackground.
But adding these to my settings.json doesn't seem to update the active element:
"other.setting.foo": "bar",
"activityBar.activeBorder": "#8A2BE2",
"activityBar.activeBackground": "#FFB6C1"
"other.setting.baz": "qux",
activityBar.activeBorder and activityBar.activeBackground need to be nested inside workbench.colorCustomizations:
"other.setting.foo": "bar",
"workbench.colorCustomizations": {
"activityBar.activeBorder": "#8A2BE2",
"activityBar.activeBackground": "#FFB6C1"
},
"other.setting.baz": "qux",
https://github.com/microsoft/vscode/issues/84316#issuecomment-552014640
I went through https://code.visualstudio.com/docs/getstarted/theme-color-reference but can't seem to find the setting for changing the comment color.
I am currently using Atom One Dark Theme and just like to lighten the color a little bit so I can read it better.
From 1.15 (July 2017) you can change it from settings.json Ctrl+,
"editor.tokenColorCustomizations": {
"comments": "#d4922f"
},
From 1.20 (January 2018) you can also do it for each theme separately:
"editor.tokenColorCustomizations": {
"[Atom One Dark]": {
"comments": "#d4922f"
}
},
Or now you can specify settings for multiple themes at once as "[Atom One Dark][Tomorrow Night Blue]": {...}
Finding the right scope:
Developer: Inspect TM Scopes editor.action.inspectTMScopes
Selector priority:
https://code.visualstudio.com/blogs/2017/02/08/syntax-highlighting-optimizations#_textmate-themes
Ok, more examples (for js):
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": "INSERT_SCOPE_HERE",
"settings": {
"foreground": "#ff0000"
}
}]
}
comment
punctuation.definition.comment
comment.block.documentation
storage.type.class.jsdoc
entity.name.type.instance.jsdoc
variable.other.jsdoc
1.Go to your settings.
2.Type “editor.tokenColorCustomizations” into the search bar then click on “Edit in settings.json”:
3.By default, “editor.tokenColorCustomizations” is set to “null”. To customize the comment color, you can add:
{ "comments": "[color code]" }
You can type something like this:
> "editor.tokenColorCustomizations": {
> "comments": "#e45e91" },
4.Change the color of comments,based on your liking by hovering over the color and choosing your desired color.
5.Then save the changes.(Ctrl+S)
6.Exit the program. open it again, you will see the changes.
To expand on the answer and #Johnny Derp's comment. You can change the font color and style using:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic",
"foreground": "#C69650",
}
}
]
},
background cannot be changed in this way, only the color and style. As of June, 2018.
Also in answer to a couple of comments about changing comments puntuation (like the //) colors - which now have to be separately colored with their own textmate rule, a change may be coming to fix that in the October 2019 release - at this point it is an unresolved issue but added to the October 2019 milestone. See https://github.com/microsoft/vscode/milestone/102
In VS Code: 1.56.2
Add to settings.json:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"comment.block.documentation",
"comment.block.documentation.js",
"comment.line.double-slash.js",
"storage.type.class.jsdoc",
"entity.name.type.instance.jsdoc",
"variable.other.jsdoc",
"punctuation.definition.comment",
"punctuation.definition.comment.begin.documentation",
"punctuation.definition.comment.end.documentation"
],
"settings": {
"fontStyle": "italic",
"foreground": "#287a1d"
}
}
]
}
If there is still stoff missing: CTRL+SHIFT+P => Developer: Inspect Editor Tokens and Scopes hover over the parts that are not colored correctly and add them to "scope".
There you are. :)
Looks like the token colors cannot be customized within the settings at the moment:
The most prominent editor colors are the token colors that are based
on the language grammar installed. These colors are defined by the
Color Theme and can (currently) not be customized in the settings.
Source: https://code.visualstudio.com/docs/getstarted/theme-color-reference
I did notice that if you go into the theme folders, for example:
C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\theme-monokai
and edit the monokai-color-theme.json file, look for the line with "name": "Comment" and change the "foreground" color it will work. Just make sure to restart the program.
Like Mark said, but add in the "scope": after "comment"
"punctuation.definition.comment"
to color also the punctuation,
e.g. (// in javescript | /* */ in css | <!-- --> in html).
"scope": ["comment", "punctuation.definition.comment"]
While commenting on comment subject, I found "Better Comments" extension of VS Code very useful. You can give various colors ‎to your comments and hence categorize your comments based on importance etc. ‎
Default comments color can also be changed.‎
https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
Example:‎
This extension can be configured in User Settings or Workspace settings.‎
Doc, Block, and Line settings
To have differnet colors for Doc, Block, and Line comments:
I.e. for the Cobalt2 theme:
"editor.tokenColorCustomizations": {
"[Cobalt2]": {
"textMateRules": [
{
"scope": [
"comment.block",
"punctuation.definition.comment.end",
"punctuation.definition.comment.begin"
],
"settings": {
"foreground": "#85b3f8",
"fontStyle": "bold"
}
},
{
"scope": [
"comment.block.documentation",
"punctuation.definition.comment.begin.documentation",
"punctuation.definition.comment.end.documentation"
],
"settings": {
"foreground": "#6bddb7",
"fontStyle": "bold"
}
},{
"scope":["comment.line", "punctuation.definition.comment"],
"settings": {
"foreground": "#FF0000",
"fontStyle": "bold"
}
}
]
}
}
Tested with C++.
You can modify your VS code by simply edit your setting file in VS code and follow these 3 steps.
step1:
step2:
Step3:
To change VS Code comment color
File --> Preferences --> Settings
Choose the "Workspace Settings" tab to only change it for this project
Choose the "User Settings" tab to change it for all projects
Do a search for "settings.json" and look for an option to "Edit in settings.json"
Insert this color setting for the comments somewhere inside the curly brackets:
"editor.tokenColorCustomizations": {
"comments": "#ff4"
}
It might complain that you are overriding your current color theme, just ignore that.
If there is already a section for "editor.tokenColorCustomizations" then just add the line to specify the comment color.