Sublime Forum

Add File to Project

#1

The idea here is simple: Allow the user to add just a single file to a project, rather than entire folders.

I would imagine that the file would show in the ‘FOLDERS’ pane on the left, as a top level item with no parent, although the name of the pane will probably have to change.

This is useful as a lot of projects I work on use an external config located outside of the code directory. For example, my project may exist at /home/jon/dev/ExampleProject whereas my config may be at /home/jon/.configs/example-project.yaml.

I change this config fairly often during development, and it would be nice to have it accessible through the ‘FOLDERS’ pane, and searchable through Ctrl+P, rather than having to browse and manually open each time.

2 Likes

#2

As an alternative, would it work to add your /home/jon/.configs folder to the project and use the file_include_patterns attribute to limit the listing to ‘example-project.yaml’, say?

0 Likes

#3

Have you checked out FuzzyFileNav? You could add a bookmark to the directory where you keep your config and get there pretty quick

0 Likes

#4

This works quite well.

It adds the file to a Ctrl + P search and FOLDERS pane which is useful.

Unfortunately, either I couldn’t get the file_include_patterns to work, or it doesn’t work. Either way, the folder hasn’t filtered to just a single file.
Lastly, and definitely a small point, is that it’s embedded in a folder, instead as a top level file, which does mean it’s one click further away than my imagined proposal.

0 Likes

#5

FuzzyFileNav seems pretty nifty.

Although I have no idea how to create the bookmarks.

0 Likes

#6

Huh, strange. In case it’s helpful, here’s a bit of a -project file that works for me (build 3103 x64, running on win7):

{ "folders": [ { "name": "dev code", "path": "C:\\Users\\pardre1\\documents\\vdw\\utilization", "file_include_patterns": ["*.sas", "*.txt", ".gitignore"], "folder_exclude_patterns": ["cmd_analysis", "warehouse_monitoring"], "follow_symlinks": true } ] }

1 Like

#7

Ah, the folder_exclude_patterns is what I needed.

This is as close as it’ll get to what I asked I think, unless this feature is actually added.

Thanks man!

1 Like

#8

Also there’s a working example of setting up bookmarks on github

0 Likes