23

In my PhpStorm project, I have a few files that sit in the root folder and are not modified often.enter image description here

For example here I rarely touch files like favicon, gruntfile, humans, package, robots, gitignore. So out of all 9 files I only need 3. I can not remove them (they still needed for the project) and they distract my attention.

So I am looking for a way to hide/exclude them. I was able to find similar approach with folders, but it works only with folders. On official phpstorm page there is a page which sounds similar but does something completely different (files still stay in the few, you just can not autocomplete anything from them). Also this answer from SO is also dealing with code inspection, not hiding files.

Community
  • 1
  • 1
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753

3 Answers3

63
  1. Settings | Scopes

  2. Create new scope that would include only files/folders you want (or opposite: exclude all unwanted files/folders)

  3. Use that scope in Project View panel instead of default "Project"

LazyOne
  • 158,824
  • 45
  • 388
  • 391
26

Or even easier: click on the gear icon in the project pane and untick "Show excluded files".

Cesare D'Amico
  • 439
  • 5
  • 6
  • Ugh, how frustrating it is when not even *this* one works! Thanks though, really useful to know – damd Nov 03 '16 at 16:17
  • This works, but toggling that setting only updates files once. I have to do this every time I have any changes to my file tree to see them, and it doesn't matter if I set it on or off - only that I toggled it. That's in `vendor` directory for composer, Phpstorm 2019.1.3 – gvlasov Sep 28 '19 at 21:23
  • Newer PhpStorm versions have this option under the `Project Panel > Gear Icon Button > Tree Appearance > Show Excluded Files` – John Kary Jan 21 '23 at 16:01
1

For later versions of PhpStorm (I'm using PhpStorm 2022.1):

  1. Exclude unwanted files or folders
  2. Open preferences
  3. Search for show excluded
  4. Under the Keymap menu, define a shortcut for toggling Show Excluded Files and press OK
  5. Use the shortcut in the IDE to show/hide excluded files
skirato
  • 763
  • 6
  • 26