andrewb
andrewb

Reputation: 5339

How can I navigate the VS Code Explorer & open a file via keyboard only?

I'm doing a code review of a project, which means cycling through all the files in it. I want to keep my hands on the keyboard but neither do I want to have to CMD+P and type in the name of each file.

I've bound CMD+K,CMD+E to workbench.files.action.focusFilesExplorer which enables me to easily get to the Explorer, but then I can only explorer.openToSide, which isn't exactly what I want. I want to be able to open them directly, full-screen even if I have other windows open.

Are there commands for this that I can bind to? I suspect this isn't a feature yet.

Upvotes: 22

Views: 16172

Answers (3)

Anatoliy Oblaukhov
Anatoliy Oblaukhov

Reputation: 145

After workbench.files.action.focusFilesExplorer you can press Up or Down to navigate through file list while File explorer is fosuced. Then hit Enter to open the selected file.

Also I set Ctrl + E for workbench.files.action.focusFilesExplorer.

In my case, sequential navigating through list of files is a repeating sequence of these shortcuts:

  • Ctrl + E
  • Down
  • Enter
  • ...
  • Ctrl + E
  • Down
  • Enter
  • ...

Upvotes: 1

chmac
chmac

Reputation: 12625

By default on a mac you can use cmd+down to open the file.

Pressing Enter will edit the filename.

Upvotes: 31

Gama11
Gama11

Reputation: 34128

To open a file, just press Enter once you've selected it. It's bound to the list.select command by default. This also works for expanding / collapsing folders.

Upvotes: 9

Related Questions