VSCode keybinding to hide Explorer

37,093

Solution 1

Toggle Sidebar Visibility: Ctrl+B (Windows/Linux)

If you're a MacOS user, then it's + b.

Visual Studio Code Key Bindings

Solution 2

If you're a MacOS user, then it's + b.

I won't leave you without a GIF.

shortcut for mac VS Code

Solution 3

Some clarification: usually Ctrl+B is used for closing a sidebar (not toggling by default). So if you haven't a sidebar and want to open it - press the following combination: Ctrl+Shift+E(opens the sidebar with active explorer) or Ctr+Shift+F (with active search) etc. Now if you want to get rid of a sidebar press Ctrl+B. Note if you're using vim plugin and want to close a sidebar but currently is working on your code - first make a sidebar active by pressing (Ctrl+Shift+E) and then close it via Ctrl+B.

update: recently I've discovered that Ctrl+Shift+E doesn't play nice with my neo vim plugin, so in order to overcome it there is another shortcut to open sidebar explorer: single press of Ctrl+0 to open it and pressing of Ctrl+0 one more time to get focus on it.

Solution 4

I'm using Visual Studio keymap. On my keyboard shortcuts, Toggle Side Bar Visibility was set to CTRL+B but doesn't works.

I do remap to CTRL+B and works fine.

File > Preferences > KeyBoard ShortCuts

Solution 5

VSCode default Keybinding for Toggling "Side Bar" aka "Explorer" is CTRL+B. Just CTRL+B alone works fine.

Share:
37,093
Cristian Muscalu
Author by

Cristian Muscalu

"We'll have to wait for the server to respond and we won't be able to block the UI while we wait, even if we want to (which we shouldn't)."

Updated on July 08, 2022

Comments

  • Cristian Muscalu
    Cristian Muscalu 6 months

    Is there any keybinding in VSCode that can hide Explorer, like Ctrl+Shift+E works for showing it?

    I hate reaching for the mouse and I don't have enough screen space to keep Explorer always on.

  • petzi
    petzi almost 4 years
    I had to resign shortcut priorities, because on my Mac CMD-b was assigned also to "Navigate Next in Quick Open".
  • rtviii
    rtviii almost 3 years
    I had Vscodevim hijack the Ctrl + / on the first installment. In case anyone's wondering about the actual keybinds.json name, it's workbench.action.toggleSidebar.
  • Liviu Trifoi
    Liviu Trifoi almost 3 years
    It didn't work in my case as ctrl+b was assigned to both workbench.action.toggleSidebar and some debug command (by default, I didn't change anything). Editing the workbench.action.toggleSidebar shortcut and pressing ctrl+b will show you if you have such duplicates and so you can delete/change the conflicting keybindings on a case by case basis.
  • Irfan wani
    Irfan wani almost 2 years
    I don't think your answer is right as ctrl + \ is used to split the editor
  • Gurnard
    Gurnard almost 2 years
    for me it does not work when the editor is focussed. I have to do CTRL + SHIFT + E to focus the explorer and then CTRL + B really not impressed with this
  • Gurnard
    Gurnard almost 2 years
    This is what works for me when the editor pane is focussed. but that is a bit poop. If I am on the editor I just want to close the explorer for real estate not switch to explorer then hide it. Netbeans gives me CTRL + ESC from anywhere to hide the side bar.
  • vhs
    vhs almost 2 years
    Not sure why you didn't just edit the correct answer from a year earlier. So I did it instead.
  • Shawn Zhang
    Shawn Zhang over 1 year
    I would say, Shift+B is better choice for workbench.action.toggleSidebar if there is a vim plugin using Ctrl+B
  • Juan
    Juan about 1 year
    I would expect the sidebar would close with the same shortcut that opens it... That's how Phpstorm does it, and it feels more natural.
  • flodis 9 months
    Maybe in the future the sidebar could be easier to hide/show if it had a little tab or made itself known when mouse is on the left edge of the application screen. CTRL+B and similar is is not easily remembered if you work with 65 other amazing IDE;s the same day. Eclipse already occupies half of my flash memory brain cells.
  • Gregory Bologna 8 months
    Ctrl+B works on Windows