How to assign Shortcut for "Go to the next location in the list" in "Find Results 1" window? - visual-studio-2017

How to assign Shortcut for "Go to the next location in the list" in "Find Results 1" window?

I SWEAR it used to be what you listed, but it doesn't work anymore. If you do a global search and want to go to each found result one after another, it now looks like the shortcut is Edit.GoToNextLocation

You can assign a shortcut to the Edit.GoToFindResults1NextLocation command in Visual Studio keyboard options.

Related

Is there any way to reset the default option as "Current File" in "Replace" of WebStorm?

Is there any way to reset the default option as "Current File" in "Replace" of WebStorm?
Is there any way to reset the default option as "Current File" in "Replace" of WebStorm?
You cannot.
You cannot set a specific entry as a default one.
The IDE will (should) remember the last option used when you invoke "Find/Replace in Files" next time.
If you invoke "Find/Replace in Files" from a folder context (e.g. from the Project View panel) then the IDE automatically will select that folder as an option instead of what you have there from the previous time.
The reason why I need it cause it'll be better for me to get a quick and entire view for the content I am searching.
You can see the same "entre view" using in-file replace:
There is an "Open in Find Tool Window" button in the search toolbar that will open ALL matches in a standard Find Results toolwindow (the same window that you get when you hit the "Open in Find Window" button in the bottom right of Find/Replace in Files). So ALL matches will be listed there;
the Preview area is also available (may need to enable it first -- there is a button for that). It also allows editing the file content right there.

How to automatically fill "go to everything" [ctrl + t] with current text selection

When I have text selected in a VS 2017 text edit window and then hit ctrl+t to do ReSharper's 2017 Ultimate's "go to everything", the selected text is not automatically placed into the "go to everything" search field.
As automatically pasting selected text into search dialogs is pretty standard functionality, I'm hoping there is a way to configure ReSharper to do this but have not been able to find one.
Does anyone know? Thanks in advance!
Try ticking the checkbox Remember last search on ReSharper | Options | Environment | Search & Navigation page. According to the WebHelp page https://www.jetbrains.com/help/resharper/Reference__Options__Environment__Search_and_Navigation.html, that should help
ReSharper can remember the last input that you used to find something
with Search Everywhere/Go to Type, Go To File, and Go to Text actions.
When this option is selected, ReSharper will also use your current
selection in the editor as the initial search query. For example, you
can select a file name in a string and then press Ctrl+Shift+T to
search for files in your solution that match this name.

Visual Studio ctrl-H sometimes doesn't automatically select 'selection'

When I select text then hit Ctrl+H, the popup dialog doesn't always show "Selection". Sometimes it gets 'stuck' with "Current Document".
I'm seen this bug for every VS version of Professional and now Community over almost 10 years now...
I select some text, in Visual-C++, then click Ctrl+H.
The upper-right replace dialog pops up with "Selection". This is expected.
Smack Esc to hide it.
Now, place cursor at empty line.
Click Ctrl+H.
Dialog again pops up with "Current Document". This is expected.
Esc
Select the same text as in step 1.
Dialog again pops up, BUT with "Current Document" instead of "Selection."
and I have to manually use dialog's pull-down to set for "Selection."
Is this a bug or am I missing something?
I want it to always set "Selection" if I select text then hit Ctrl+H.
You should select two or more lines to always get the Selection option by default on Find and Replace window, this is necessary if you previously opened the Find and Replace window with the Current Document option.

Visual Studio go to bookmark only inside current file

Is it possible to go to the next/prev bookmark only inside the current file? I'm using VS 2010 and I find it extremly annoying that it jumps always across all files when I want to navigate inside the current file only.
Yes. Go to "customize" (right click on the toolbox area, choose customize) ->commands->keyboard, choose edit.NextBookmarkInDocument and associate it with a shortcut.
In addition, you can add it as a button in the text editor toolbar. Go to to text editor toolbar, press the little mark on the bottom-right,and choose the appropriate button to add.
Set bookmarks to stay in one file in Visual Studio 2019
In the Search box at the very top menu, put in ‘customize’ and hit Enter’.
A complex box comes up, but I simply clicked on a button at the bottom labelled ‘Keyboard’, which is where keyboard shortcuts can be set up.
That brings up another huge box. In the left hand pane is Environment and under that is Keyboard. I guess that the way I went in is why this was expanded and already selected, so there must be other ways to get to the same place.
In a right hand pane is now a huge list of commands that can have shortcuts attached!
The ones to scroll to (enlarge the box or the scroll bar is a joke. A slight move scrolls dozens of lines!) are Edit.NextBookmarkInDocument and Edit.PreviousBookmarkInDocument. (similar commands without ‘inDocument on the end are what f2/ shift f2 do by default and jumps between files rather than staying in the same document.)
When you select a command you can then just click on the field labelled ‘Press shortcut keys’ and then press the keys you want to be the shortcut for that command.
I assigned Edit.NextBookmarkInDocument to f2, which then replaces the old f2 that jumps from file to file, and shift f2 for Edit.PreviousBookmarkInDocument. You have to press the ‘Assign’ button to make VS remember the change. After this, bookmark jumps stay in the same file. I guess you could choose any shortcut you fancy, and it does at least show you if that shortcut is assigned and what it is assigned to.
There are some features which I have not explored, like when I use f2 it shows it is assigned to ‘Rename’ but it seems to not effect that function at all when you reassign and just takes it away from the jump between files command version. Maybe someone would like to delve deeper, but what I did worked without any side effects and renames outside of VS still worked with f2 so I have no idea what it was going on about.

How to instantly change name of variable for all references in project

I am working on some game in VS10, and I want to change the name of some variable, because I want to expand the game, however there is so much references to it, that I don't know from where to start. Is there any hotkey in VS10 that will do this in a moment for me? I know there is NetBeans hotkey CTRL+H, but this doesn't work for VS10.
First, any variable should always be declared and used in the smallest of scope.
In VS2010, whenever you rename a variable, it will prompt you whether you want all references to this variable is to be so renamed. A little red bar will appear underneath the name where you changed it. Move your mouse to that bar and an icon will appear with "Options to update references to the renamed object". You can choose between renaming all right away or with preview.
(The ability to rename all references to the renamed variable disappears when you go and rename another different variable. Perhaps there is a way to go back to an older rename but I have not found it.)
I tried renaming a public property of a class. The automatic renaming works too for references to that public property, at least when both are within the same code file.
As Retired Ninja said in his comment, you pretty much need add-ons for Visual Studio (like Visual Assist X).
Installing Visual Assist will give you a menu like this:
... where the "Find References" button searches for all references to that variable/function/namespace/etc and replaces it (not just a plain text search).
Other alternative is to open the "Find and Replace" window (press Ctrl+F), and click "Quick Replace". From there you can do a plain text search and replace (there's also wildcard and regex support (under "Find Options->Use:), if that helps).
There is CTRL+H in VS10 too. If you press it on the right side pops out panel which is basically interface for what you want to do about the modification. It has everything included, to modify that name only in the document/s which is/are currently opened, or even in the whole project. Bad thing is that replaces that name with everything it encounters, except for header name. So if I have something like fruit.h and I want to rename it in apple.h, everything will be renamed to apple.h except the name file, so it will throw an exception that aformentioned header couldn't be found.