is there a way to filter files by name in vs code? - visual-studio-code

Is there a way to filter files by name in VS Code? The search icon in the left nav pane provides the ability to do a global text search within the directory context but I haven't seen a way offhand to search for specific files. For example, let's say I want to search for "Chart.component.tsx" or find all test files in the project by searching for ".test.tsx". Is there any way to go about doing this in VS Code?

Type ctrl-P then start typing the file name. VSCode will search the directories for you.

Related

Visual Studio Solution Explorer like experience for VSCode

Sorry in advance if this is not the right place to ask but can someone help me customise VS Code to work similar to Visual Studios Solution Explorer?
In Visual Studio we have the Solution Explorer which lists all files but also there are 2 very handy view filters; found in the title bar of the Solution Explorer panel.
Open Files Filter
Pending Changes Filter
if neither is selected then default to show all files in the solution
Ideally I want the Workspace view that lists all files in VSCode, but also a toggle to only list 'Open' files. (I'm less interested in Pending Changes).
I'm aware of the Open Editors view but I find this difficult to navigate since it's a flat view and isn't a nested directory structure. When every file is called view.html in its own folder it's a nightmare to eyeball the list of files.
Also I think toggling between "all" and "open" files would be easier than going up and down between 2 panels when you want to open something new.
So is this possible, does anyone know of a way to customise vscode to get this behaviour?
Thanks in advance!

VS Code - search for two different things in two files

In VS Code how do I search for one thing in one file, while at the same time searching for a different thing in a different file?
Using the normal Find when I try to search for something in a second file it overwrites any find I am doing in a previous file.
I see that the Search functionality enables me to open a search in an editor, but this functionality doesn't seem at all useful to me.
There is no obvious way to run a search on a specific file short of manually copy/pasting the file path into the advanced search options.
The editor that the search results open in contains adjacent context lines, which if you have a large number of results makes it useless as a simple list of search hits.
The editor that the search results open in is not editable, making it useless as an editor.
I need a list of results for each of two searches on two files.
Item 1 can be handled with an extension I wrote: Find and Transform. You could make a keybinding that opens the Search Panel with the current filename (or any file/folder/etc.) added to the files to include input. Actually I added a context menu command to the editor, or any editor tab or an editor in the Explorer to do just this.
Item 2. The search editor number of context lines is configurable and will remember your last setting.
Item 3. There is an extension, Search Editor: Apply Changes which can apply any changes you make in a search editor to those files.

Filter the sidebar in VS Code to only show certain folders

I find myself in a situation where let's say I'm working on something to do with Cats, and I want the siderbar of Vs code (where it lists a directory of folder/files in my project), but filtered to only include folders with the word Cats in them. This wouldn't be my entire project, just a few folders to do with Cats, so I can focus more easily. Is there such a thing like this in the form of an extension, it would help me a lot.
First make sure you are using the latest version of Vs Code.
Tap with your mouse on the directory sidebar. Then start typing. A small search window will appear. Then hover over the search window and press the appearing button. (the three thin stripes). Vs Code will then filter on your search.

How to: Go to file (#) Go to for symbol in the same dialog

I am missing this feature from Sublime Text so much. Go to Symbol in Workspace feels so close to it and yet so far away.This is very useful in the following examples:
You have many classes that have the same symbol/function name, Pre-filtering the file lets you jump to the exact definition very fast
You know the name of the file, but you are not sure about the exact symbol/function name. Fuzzy searching it is super fast
You want to quickly preview the available symbols/functions in a given file
Here is a sample video demonstrating this feature in Sublime Text:
https://youtu.be/48f3N0hCaBU?t=109
If this is not currently possible, is it possible to implement as extension?
This is being added in v1.44. See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_44.md#navigate-from-files-into-symbols
You can now continue to navigate into symbols of a file result simply
by typing #. For the file that is currently selected, all symbols will
appear and the editor will open in the background to reveal the active
symbol.
I created an extension that provide similar functionality:
https://marketplace.visualstudio.com/items?itemName=Cmacu.gotoanything

What is shourtcut for files in Netbeans

I realy dont know how to ask this one, so I will try to describe it.
I am pretty sure that there is a shortcut in NetBeans for files.
And when I want to get path to web/img/sample/fileWithStrangeName I dont want to type it and make some mistake.
What is shortcut in netbeans for that kind of navigation?
As you can see from the http://wiki.netbeans.org/Keyboard_Shortcuts there is no direct way to do this using a keyboard shortcut for any version until now.
What i do is right clicking on a file and then select properties. And then copy the value of the All Files property.
Another way is to use the plugin Explore from here, that opens the file in its location. And then copy the path from that window.