Atom: How to search in only the current folder? - atom-editor

I've read the documentation here and about Glob pattern, but still couldn't find a way to search the current folder only(not including the subfolders).
That is, if I open "search in project" and type "meta/*.php" into the "fire/directory pattern" field, the search will be against all *.php files in folder "meta" and all of its subfolders.
So how do I search the "meta" folder only?

If you are using glob with depth unknown subfolders are included in search otherwise it will search in the specified folder only
C:\\dir1\dir2\*.ext
The above pattern will search only in the files with extension .ext inside the dir2 excluding subfolders
C:\\dir1\**\*.ext
The double star is called unknown depth and will search in the files with extension .ext inside dir1 including all subfolders

Related

How Can I exclude some files in visual studio finding?

I have a project in asp.net web form and I want to search all files which contains "~/Products" with ctrl+shift+f but I want to exclude a file which is Server.Transfer("~/Products"). I tried regex but it did not work. How Can I do this with regex or something else?
I tried
*~/Products*;!*Server.Transfer("~/Products")*;
If you want to search all files which contains "~/Products" and exclude a file which is Server.Transfer("~/Products").
You can try this regex:
^((?!Server\.Transfer).)*~/Products((?!Server\.Transfer).)*$

Atom search wildcard Fuzzy Find Files

Is there away to search for files using wildcard with the Fuzzy Find Files in Atom (cmd-t cmd-p)
e.g.
*query.js
shows
jquery.js
Press Ctrl+Fand then Ctrl+Alt+/ for regex search
https://discuss.atom.io/t/search-wildcards-for-find-replace/16928
the key cmd-b will make a wildcard search

How to exclude subfolders and files in the Search pane of LightTable?

What is the syntax of the Locations field in the Find and Replace pane of LightTable? (which appears when hitting CTRL-SHIFT-F, or CTRL+SPACE then Searcher: show)
I would like to exclude all files of the docs/ subfolder, as well as all *.txt and *.csv files of my workspace. What should I enter in the Locations field to exclude them from a search & replace?
Or inversely, I'd like to include only the files from the src/ subfolder. How would I accomplish that?
There doesn't seem to be a way to exclude directories or file patterns right now. However, you can specify which directories to include. You will have to write the whole path though (relative paths use Light Table's application directory). If you want to have more than one path you can separate them by using a comma:
/absolute/path/to/first/dir, /absolute/path/to/second/dir

ASP.NET localized files

I've got a web page with a link, and the link is suppose to correspond to a PDF is the given user's language. I'm wondering where I should put these PDF files though. If I put them in App_LocalResources, I can't specify a link to /App_LocalResources/TOS_en-US.pdf can I?
The PDF should definitely not be in the App_LocalResources folder. That folder is only for RESX files.
The PDF files can go anywhere else in your app. For example, a great place to put them would be in a ~/PDF folder. Then your links will have to be dynamically generated (similar to what Greg has shown):
string cultureSpecificFileName = String.Format("TOS_{0}.pdf", CultureInfo.CurrentCulture.Name);
However, there are some other things to consider:
You need a way to ensure that you actually have a PDF for the given language. If someone shows up at your site and has their culture specified as Klingon, it's unlikely that you have such a PDF.
You need to decide exactly what the file format will be. In the example given, the file would have to be named TOS_en-US.pdf. It you want to use the 2-letter ISO culture names, use CurrentCulture.TwoLetterISOLanguageName and then the file name would be TOS_en.pdf.
I would store the filename somewhere with an argument in it (i.e. "TOS_{0}.pdf" ) and then just add the appropriate suffix in code:
string cultureSpecificFileName = string.Format("TOS_{0}.pdf", CultureInfo.CurrentCulture);
Does the PDF have to have the same file name for each of the different languages? If not, put them all into a directory and just store the path in your resources file.

What's the most simple way to get files only visible in Finder in a directory?

NSFileManager has several method to enumerate directory contents, but they returns all files including hidden or system files which is invisible for users in Finder.
I want to get the file list same as Finder. As possible as simple. What do I have to do?
Test the filename, usually a hidden file begins with a "." (period).

Resources