Sublime Forum

Sublime Text 2: How to add one file to project

#1

Hi guys,

I want to add only one file to my sublime project. I don’t know how. Is there a way to do it?

0 Likes

#2

There is no way.

0 Likes

#3

If you were really ambitious, you could add the folder containing the one file that you want, and then make exclude patterns in your project to exclude all the other files in that folder.

0 Likes

#4

This works for me:

{ "folders": [ { "path": "/path/to/project" }, { "folder_exclude_patterns": [ "**/**", ], "file_include_patterns": [ "file-to-include.txt" ], "path": "/path/to/one/file/" } ] }

0 Likes

#5

copy-paste from https://stackoverflow.com/a/39386785/5728089, which seems quite like the solution by jtsternberg, but shorter:
“folders”: [
{
“path”: “path/to/the/folder”,
“folder_exclude_patterns”: ["/"],
“file_include_patterns”: [“file_to_include”]
}
]

0 Likes