Filter Explorer pane for specific file types?

I've just installed Visual Studio Code and am using it to browse a folder for a project written in Python. Is there a way for me to tell Visual Studio Code to filter the view in the Explorer pane to show only certain files -- specifically, only those files with a .py extension which are Python source code files?

Brandon Taylor

1 answer

  • answered 2019-11-14 10:03 John Archer

    Kind of. First I would suggest to open the settings and set workbench.list.keyboardNavigation to filter (so your list get filtered immediately). Now be sure to have the focus on the explorer window. Now type simply start to type .py. It will filter all files that contain the filter string in its filenames. It seems that you can't use regex to be sure to just find files that end with .py. You would also find a file like animal.python.js. But I think this is a good start and fits most cases.

    You can enable, disable and clear the filter when hovering over the filter string on the right side of the explorer window and click the appropriate buttons.

    Additional informaton can be found here.