When using VSCode on Windows, I can navigate the file explorer and hit Enter on the focused file and the file will open in the editor. On my Mac, however, when I do this, VSCode will open the rename input as follows:
I'm not sure why it does this. Even in other text editors (e.g. Atom), the default behavior is to open the file on Enter. Is there any way to change this behavior so that the file opens on Enter? The only workaround I've found so far is CTRL+Enter, which opens the file in a new pane, but with a 3 pane limit in VSCode, this is quite limiting.
In preferences:
Code -> Preferences -> Keyboard Shortcuts
Add this to your keybindings.json
within the array that may or may not contain other keybindings you have set. Save keybindings.json
Then when you navigate to a directory in the file explorer, you can create a new file with ctrl+n
If anyone else comes across this problem, the keyboard shortcut to open a file from the file explorer in VSCode on a Mac is:
CMD+Down
This also works in Finder.
cmd+down
does NOT work for me using VSCode 1.10.2 on Mac 10.10.5.However,
cmd+enter
does work for me.Or if you want to set your own keybinding to open a file from File Explorer, add these lines to your
keybindings.json
:(Of course, you can change
enter
to any key combination you want).I ended up compiling a few solutions here together to get the following
keybinding.json
editions (Open viaCode > Preferences > Keyboard Shortcuts > keybindings.json
):