Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode hide top-right icons

I'm a big fan of VScode's minimalist approach, but one thing is bugging me. I would like to hide editor-tab icons.

enter image description here

The icons are from extensions: git-lens & hexdump for VScode. Also the split-editor icon would be nice to hide.

like image 742
PencilBow Avatar asked Nov 13 '17 14:11

PencilBow


People also ask

How to hide the top bar in VSCode?

Create file /Users/ (yourusername)/.vscode.css and paste there: .title.show-file-icons { display: none !important; } Change vscode settings adding: "vscode_custom_css.imports": ["file:///Users/ (yourusername)/.vscode.css"] It should hide top bar. Show activity on this post. Install: multi-command, Settings Cycler, Customize UI extensions.

Is there a way to hide split editor right button?

For selecting icons to hide is is way easier since you can select them one by one, see above comments. To hide the Split Editor Right button, you might need something like this to escape the backslash I'm using the Custom UI extension. It looks easier to install and maintain. I installed it, activated with CTRL + P, "Enable Monkey Patch".

Is it possible to hide the Ctrl-P and Ctrl-Shift-P buttons?

and to the buttons in the panel title bar: For users who have already memorized the keyboard shortcuts for these commands (and considering the existence of Ctrl-p and Ctrl-Shift-p), the buttons are kind of redundant. It would be nice to have an option to hide them as almost everything in the UI already can be hidden.


7 Answers

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;
}
like image 64
Alex Avatar answered Oct 12 '22 18:10

Alex


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:

enter image description here

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:

enter image description here

So I came up with this idea:

Showing the icons bar below the tabs (not over the tabs) when hovering

Here is the result:

enter image description here

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;
}
like image 27
Vincent Avatar answered Oct 12 '22 17:10

Vincent


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:

icons in 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.

like image 33
carlfriedrich Avatar answered Oct 12 '22 19:10

carlfriedrich


Without extensions

  1. 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
  1. 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

like image 33
teraoka Avatar answered Oct 12 '22 18:10

teraoka


Here is a better extension for this. Customize UI

like image 29
mozlingyu Avatar answered Oct 12 '22 17:10

mozlingyu


Gitlens icons can be disabled within the extension settings:

https://github.com/eamodio/vscode-gitlens/issues/669#issuecomment-540975432

like image 33
Cibergarri Avatar answered Oct 12 '22 19:10

Cibergarri


In Insiders v1.72 now is the ability to hide/show any of the icons on that toolbar, see /hide menuItems.

remove tab toolbar icons

like image 23
Mark Avatar answered Oct 12 '22 19:10

Mark