Visual Studio Search Filter? - visual-studio

Visual Studio:
Quite often, I search for say "max-" in "Current Project" and I have to spend time hitting the "->" (next button) whilst it informs me of all of the jQuery/knockout/bootstrap. files that contain this string. None of which I am interested in. I'm only interested in my code (for example).
Does anyone know of a way (may be through an add-in), that you can mark files/folders in a Solution with "Do not Search"?
Filtering by file type (eg ".cshtml") is not sufficient.
I am aware of a workaround using "Find All", that makes it easier to pick the ones you want. However, even that option would benefit from a filter.
Thanks Rob

There is an button after the Look in option dropdown, marked with [...], in the dialogue that pops up, you can select the folders that you want to search in.

Related

What is the Visual Studio search/replace free entry "look in" field for?

In Visual Studio 2015 "Find and Replace" window, you can freely type anything you want into the "Look in" field:
The preset dropdown values are things like:
Current Window
All open documents
Entire solution
etc.
What is the purpose of allowing typing in this field? What could I possibly type in here which would make any sense?
And if I do type something like "foo bar" in there, what is the behavior when one of the "Find..." buttons is clicked? It seems to just search normally - maybe in the current solution (??).
Note - it even seems like mistaken entries can get stuck in there.
That allows one to specify directories. Or even multiple directories. Or even combinations of built in locations and directories. Separate each location with a semicolon.
Example:
Entire Solution;C:\Source\18.1
Then to remove an entry, click on the ... button. This will bring up a dialog box titled "Choose Search Folders". Then on the right hand side, selected the entry you wish to remove and then click on the button that looks like a less- than, or left-angle bracket. This will remove the entry.

VS2015: Can I mark down code?

When I'm working at someone else's code, sometimes it happens that I've found something useful that I likely will need to return later to.
Except the chances are that I forget where I've found that part and then I need to find it again. Nowadays I'm mostly using breakpoints to set these down, But I don't need these breakpoints for debugging, so I don't think that's the most efficient method. Something that could work for me is a sort of marker that functions marking down like a breakpoint, but does not affect debugging.
Will all these ways of breakpoints, search functions, finding references, and adding a Watches. I do have a feeling that such feature is present in Visual Studio already. But I havn't found it yet, I've already tried searching it up, but it looks like it hasn't asked before.
So, is there a feature in Visual Studio that let you mark down code like breakpoints, but just for the purpose of marking down?
There is more than one way to do so.
If I finde something interesting I mark it with a Bookmark.
Just STRG + K, STRK + K and it will be places on your current row.
With these Buttons you can switch to your bookmarks or delete them all. They are client based.
Visual Studio also gives you a "To Do List" Function. This one is triggered by comments in the code and seen for everyone with the right options used.
See here how it works in detail.
Yes, it's called a bookmark. This little toolbar is for bookmarks:
You can also use the Edit, Bookmarks... menu item and the View, Other Windows, Bookmark Window which among other things lets you see all of them and give them names.
One caveat: the bookmark binds to the line number, and doesn't move if you add or remove lines. So if you bookmark the first line of a function, then make changes above that, the bookmark won't be on the first line of a function any more.

Is there a way to make the Quick Find dialog wait until you hit enter to find results in Visual Studio 2015?

When I'm trying to search for something in the current document, I think it's really annoying that VS immediately starts trying to find a match when I've only typed a single character. The document ends up jumping all over the place, causing me to lose my spot. Is there any way to make it so VS doesn't start looking for results until I actually hit enter?
You could just use the find and replace dialog instead of quick find. ctrl+shift+F or Edit > Find And Replace > Find in Files. Then just switch the dropdown to current document. Although this creates a list that you can click through rather than navigating directly.

Incremental Search vs Quick Find in Visual Studio

What is the difference between Incremental Search (Ctrl + I) and Quick Find (Ctrl + F) in Visual Studio?
as I said in the comment of mine , that's not the only reason and microsoft would not implement something like this for just being easier to use !
by the way you don't need F3 to navigate between the results in the normal find method . you can do that with hitting enter and hell yea , its easier than Ctrl+I.
You can press Ctrl-I and start to type and all occurrences of what you type get highlight throughout the document, and also added to the find buffer, so F3 then works on the typed text as-well as the normal find method.
Incremental search allows developers to search in document without blocking UI and allow to search as they type.
The very good reason to use Ctrl+I is it find the result as you type the term in the box and you don't need to hit enter or F3 to go to the first result .
How To :
To enable incremental search, just type “Ctrl + i” within the editor.
This will subtly change your cursor, and cause your status bar at the
bottom left of the IDE to change to “Incremental search: (search
term)” – you can then type the search term you are searching for and
the editor will search for it from the current source location you are
on (no dialog required).
Note that the version of Visual Studio will affect the UI differences. It seems that in older versions e.g. 2010, the find dialog was quite obtrusive, and got in the way of things and so incremental search was by comparison more streamlined. Conversely, running on Visual Studio 2015 I've found that the Find Dialog (at least the one launched by CTRL-F) is very unobtrusive, since it is embedded in the top left of the code editor. Hitting CTRL-I in fact launches a similar dialog with fewer options. Furthermore I also find with this version of VS the editor jumps to the first matching occurrence as with incremental search, so there is barely any difference in terms of how streamlined/unobtrusive one is over the other.
Assuming one is using a version of Visual Studio where the Find Dialog is embedded in the corner, the only reason I can think to use incremental search over the standard find is the fact that you can reverse search with CTRL-SHIFT-I (the alternative would be to CRTL-F to go to the next occurrence, then SHIFT-F3 to go backwards).
Long story short: it looks like the standard find has been modernised somewhat bringing it closer to the incremental search. If using VS2015 (not sure about 2017) the difference appears to be fairly negligible besides the differences in shortcuts, and so is really a matter of preference. Personally, in VS2015 I find the incremental search to be of little improvement over the standard find, and so I'll be sticking to the latter (unless I've missed something in which case I'll be glad to hear about it!)
Incremental search allows you to keep hitting Ctrl+I until you hit the end of your document. Quick Find finds the first hit, highlights every other hit but you'd need some additional keys to go the the next hit (F3 with standard keybinds).

Save searches in Visual Studio

Is there a way to save a search information in Visual Studio. For example if I'm constantly searching for "This string", match case, match whole word, look in 'Current Project'. Can I store this somehow as a saved search?
This is easy to do with a macro. Start with Tools + Macros + Record. Do a search, setting all the options you want, click Stop Recording. View + Other Windows + Macro Explorer. Rename the "TemporaryMacro" to something more suitable. Tools + Customize + Keyboard and assign a keystroke to the macro.
You now have a single keystroke to execute the search.
I found that if you do the following in VS2012:
1) Copy and paste the file types list back into the "Look at these file types" search box
2) Click and unclick the "Use Regular Expressions" checkbox
3) Press "Find Next" before "Find All"
4) Close visual studio and reopen the solution
For the actual search string I think if you make sure your cursor is positioned on a blank line, it will also reuse the last search string, otherwise it will pick the string under the cursor.
Then (at least VS2012) will remember the last search options. You may or may not also need to click your heels and perform some voodoo magic that i was doing at the time on the side (that part is a secret, sorry)

Resources