Sublime Forum

Ability to remove single folder from project

#1

I’m running Sublime Text 2 on OSX, and I can’t seem to figure out how to delete a single folder from a project. I see that you can remove all folders by going to Project -> Remove All Folders From Project, but I can’t seem to delete folders individually. It would make sense to be able to drag folders out of the sidebar and have them vanish, the way the sidebar works in Finder. It would also make sense to be able to highlight a folder and press the delete key, and also have it vanish, or fly out to the right. However, neither method seems to work and I don’t know what else to try.

0 Likes

#2

There isn’t a way to remove just a single folder in the current alpha - there will be in the future though, it’s early days yet.

0 Likes

#3

Thanks, I came to ask about this.

0 Likes

#4

This is implemented in build 2025! Check it out: sublimetext.com/dev

0 Likes

#5

You can remove a “project” folder, but not folders within a “project”.

0 Likes

#6

You could use the “folder_exclude_patterns” preference to exclude the folders you don’t want.

0 Likes

#7

Is it possible to make this functionality a bit more specific? For instance, I have 2 folders with the same name in different parts of my project, but I only want to hide one of the folders. For instance one is at the root level, and one at a different level in the directory structure.

e.g.

App/foo

vs

App/bar/foo

0 Likes

#8

It would be great to be able to remove any folder in the hierarchy via the contextual menu instead of needing to mess with the folder_exclude_patterns.

0 Likes

#9

Bumping this. It would be nice if the “folder_exclude_patterns” was not recursive. Currently, if I have a folder included with the path “/c/code/myproject”, and that folder contains a folder “myfolder” which I want to exclude, but a folder named “myfolder” also exists within another folder in the “myproject” folder, both of the “myfolder” folders will end up being excluded. This isn’t ideal. :smile:

0 Likes

#10

You can make the pattern more specific and that way it won’t recurse:
In “folder_exclude_patterns” instead of “myfolder” write “myproject/myfolder”, this way it will exclude only that one and leave in /myproject/foo/myfolder and the rest.

0 Likes

#11

What if it’s the reverse of ^ that? What if I want to ONLY exclude a base dir by a certain name but not any others named the same?

E.g.,
/exclude
/other/exclude

Excluding all directories named “exclude” is simple.
“folder_exclude_patterns”: “exclude”]

Excluding the other/exclude directory but NOT the base exclude directory is also simple.
“folder_exclude_patterns”: “other/exclude”]

However, excluding the base “exclude” but NOT the other/exclude directory does not seem possible since…

We already know this fails since it matches all patterns which isn’t the goal.
“folder_exclude_patterns”: “exclude”]

This unfortunately doesn’t work as expected. it matches NEITHER “exclude” directory.
“folder_exclude_patterns”: “/exclude”]

This last ditch attempt fails as well.
“folder_exclude_patterns”: “exclude/”]

Any thoughts?

PS - GREAT editor! Vintage mode is awesome.

0 Likes

#12

you don’t need to use any exclude pattern. simply edit the .sublime-project file “folder” attribute. it’s really straightforward.

0 Likes

#13

You would really have to wait for this one. It’s not yet available on the system. But I do hope that they release something like this soon because it’s really inconvenient for some people already.

Bump this guys!

0 Likes