VSCode keybinding to hide Explorer

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.