8

Is it currently possible to set a specific file to open on startup in VSCode? I have the 'To Do Tasks' extension installed and I want to open my TODO file by default each time I load VSCode.

Using Version 1.12.1

2 Answers 2

4

Edit: I think the best way is to use extensions that can run commands on startup. Example is: Auto Run Command


You can either create some shortcut for command code "path/to/file.todo" or change link's options.

For example(windows):

link => properties => shortcut => target => "C:\Program Files (x86)\Microsoft VS Code\Code.exe" "D:/howto.todo"

VSCode CLI documentation


Another way is to Pin editors. With setting "workbench.editor.pinnedTabSizing": "compact", they take very little space.

Sign up to request clarification or add additional context in comments.

2 Comments

Nice...I didn't even think about this method. Thanks!
Please explain how to do the link thing. The docs don't seem to include anything about it.
2

Here's the solution:

Use an auto-run task:

  1. Allow automatic tasks with this command: Tasks: Manage Automatic Tasks in Folder.
  2. Set up a task in the folder:
{ "version": "2.0.0", "tasks": [ { "label": "Auto-open my-todo file.", "type": "shell", "command": "code my-todo.md", "runOptions": { "runOn": "folderOpen", }, "presentation": { "echo": true, "reveal": "silent", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": false, } } ] } 

The key is to set runOptions / runOn to "folderOpen".

More details here: How to run a command automatically in VS Code when you open a project

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.