[help] How to open/create files by typing path?

Sorry if there's a better sub for VS Code questions, or flair or something I should apply to this post.

I'm a 15-year Vim user taking VS Code for a spin and loving it so far (with Vim extension, of course) but I'm having trouble trying to create/edit files.

Ideally I would hit a shortcut, type a file path like~/Desktop/some-file.py and hit enter to create/edit the file with path completion via tab if necessary.

Nothing like this works, tab causes the open/command palette to lose focus and even without tabbing VS Code doesn't seem to recognize tilde or really do anything as I would expect with regards to files.

Is there any way to open/edit files or folders from VS Code without using the mouse? One-offs that might not be open in Explorer.

Posted May 3, 2017, 11:01 PM UTC

73
hn17•

There's an extension for this: Advanced new file

edit: actually there are two: the other one

If you search for "file" in the extension sidebar, they show up.

3
actionscriptedOP•

Thanks for the suggestions! Unfortunately neither plugin does quite what I'm trying to accomplish and the former had an issue with ~ and was project-relative.

What I've settled on for now is:

  • Install code in $PATH (which creates a symlink in /usr/local/bin)
  • Hit ^` to open the built-in shell
  • Type code ~/some/file.txt

This way I still have tab completion, tilde works as expected and non-existing files or files outside the explorer path can be opened without issue.

I would love to have something like this via the command palette or some easier way to do this.

3
[deleted]•

[deleted]

1

Why not ctrl-n ctrl-s and type the new file name? Backwards but easy enough.

1
cg-cnu•

Hey guys! I am looking for something similar and not satisfied with the existing extensions like advanced new file. I just published a new extension super new file. Let me know if you have any suggestions or feedback. Thanks!

2