BBaysinger
BBaysinger

Reputation: 6987

How to exclude/hide specific directories/folders from search in Atom Editor, per project

I have a directory with a bunch of Bootstrap versions in it, and every time I search my project for a Boostrap-related classname, I get a list with all the hits from my Bootstrap versions. I need to know how to exclude this directory from searches. I do not want to do this globally, and I'm not looking to use the search/pattern field in the 'find' panel (unless this field can get populated from a config file in the project). I need a solution that will persist every time I open this specific project in the future. Would this configuration be in .editorconfig or config.cson?

I searched for this solution elsewhere, but there's a lot of noise in the threads related to my question, so it's hard to identify the correct/best solution.

[Edit]: To be clear, I'm not looking to rely on .gitignore, since that will result in files omitted from version control. And I'm not looking to set a preference for fuzzy-finder, since this will be global, and could exclude items in other projects.

[Edit]: This, so far, sounds like a missing feature.

Upvotes: 6

Views: 1817

Answers (3)

1lOtzM291W
1lOtzM291W

Reputation: 470

Find -> Find in Project

Example: input -dirName/subDir in "File/directory pattern" to exclude searching the directory

Upvotes: 1

Michael Cole
Michael Cole

Reputation: 16217

You can try this with Atom. YMMV:

https://github.com/atom/find-and-replace/issues/149#issuecomment-142323938

Preferences -> Open Config Folder -> config.cson):

"*":
  core:
    autoHideMenuBar: true
    ignoredNames: [
      ".meteor"
      ".git"
      "etc"
    ]

Upvotes: 2

nwinkler
nwinkler

Reputation: 54437

You can make use of the Exclude VCS Ignored Paths feature. If you check the box on this entry in Atom's Settings screen, and then add the folder that you want to exclude from the search to your VCS's ignore file (e.g. .gitignore for a Git repo), then entries in that ignored directory will no longer show up in your search results.

So if your folder is called bootstrap-versions, and your project is a Git repo, then adding

bootstrap-versions

to your project's .gitignore file will remove this folder from the search results.


As an alternative to that, you can add the name of the folder to be ignored in the fuzzy-finder Ignored Names field. Go to Settings > Packages and type fuzzy in the search box. Then select the Settings button of the fuzzy-finder package and enter the name of your folder to the Ignored Names field.

The Core Settings page has the same field, you could add the folder there as well.

Just be aware that these are global and will impact all projects.

Upvotes: 2

Related Questions