Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open VS Code with a blank text file open

I'm trying to set up VS Code such that when the program is just opened (not via the context menu for a file or clicking on a file) a new blank text file is open and ready to start typing in - similar to when Notepad++ is opened - or most other text editors, for that matter.

Searching for "VS Code open with new file" and many variants only brings me to articles/posts about opening a new file in a new tab or window. That's not what I'm trying to do.

like image 966
marky Avatar asked Jul 12 '18 16:07

marky


2 Answers

File > Preferences > Settings

Search for startupEditor

Change

"workbench.startupEditor": "welcomePage"

to

"workbench.startupEditor": "newUntitledFile"

or select newUntitledFile from dropdown

like image 197
marky Avatar answered Nov 04 '22 14:11

marky


In File > Preferences > Settings there is the following option listed under the Window section:

// Controls how windows are being reopened after a restart. Select 'none' to always start with an empty workspace, 'one' to reopen the last window you worked on, 'folders' to reopen all windows that had folders opened or 'all' to reopen all windows of your last session. "window.restoreWindows": "none",

Using the editor in the right pane you can add: "window.restoreWindows": "none"

Which will open an empty workspace with a link that says "new file". It's not exactly the solution you're looking for but it's the closest one I'm aware of.

like image 20
Rickchip Avatar answered Nov 04 '22 13:11

Rickchip