Hot key to pop open rename options? - visual-studio

When Visual Studio, when you rename a variable or type the name of a class that hasn't been included, a little box appears under the text. If you hover your mouse over it, it pops open and gives you options to either rename all the variables, or include the missing reference.
I'm sure there's a hotkey to pop this open so I don't have to use the mouse. What is it?

Press Ctrl+. to open that menu.

For me it's Shift+Alt+F10. Depending on the VS version and your keyboard settings it might be different for you.
The actual shortcut is shown in the tooltip when you check the "Show shortcut key in ScreenTips" box at the bottom of the Tools\Customize\Toolbars dialog (VS2009). This is among the first things I turn on when installing VS.

Use Shift + Alt + F10 to bring up the Resolve menu when your cursor is on the unresolved item.

Related

Go to definition in new tab without changing the view

When I do command + click on visual studio or right click and "go to definition", the file containing the definition opens in a new tab and I automatically see this file. So I change the view if the file containing the definition is another file.
Is it possible when I do this command to stay on the same file I was while still opening the other file in another tab?
Thank you for you answer.
Preferences >> Settings >> Workbench >> Editor >> Enable Preview >> Uncheck/false
If you're capable to actually go to the definition you are looking for what is called the "Peek Definition". VS Code is highly customizable so how you have it configured it could do something different.
What I think you're looking for is Ctrl + Left Mouse Click or Alt + F12.
This should tell you more, VS Code Peek Definition
Double clicking on the tab name also works if you don't want to disable preview feature of editor. Double clicked tab becomes persistent.
You can also peek definition with Alt + F12 (be sure to highlight its symbol / invocation first).
This opens the definition in a smaller resizable tab (resizable down to ~4 lines of code) and allows editing if needed.
Example (source):
Taken from:
https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition
If a language supports it, you can go to the definition of a symbol by pressing F12.
If you press Ctrl and hover over a symbol, a preview of the declaration will appear.
Tip: You can jump to the definition with Ctrl+Click or open the definition to the side >with Ctrl+Alt+Click.

Rearrange Code shortcut in Resharper doesn't work in VS2015

When I try to use the shortcut for moving lines up/down (Ctrl+Alt+Shift+↑/↓), it highlights the code and shows the tooltip message "Use Up/Down to move text line" but nothing happens. If however I try the same command via the menu bar (Resharper > Edit > Rearrange Code > Move Up) it moves the selected lines as expected.
I used to use this feature all the time so I find this bug very annoying. Apparantly, others also experience this (see comments for Resharper move line up down not working) but I haven't been able to find a solution for it. Resetting keyboard layouts and reapplying VS keyboard schemes doesn't work.
Has anyone been able to resolve this issue?
[EDIT]
Reason of this is issue (when you are logging to machine with VS and Resharper via Remote Desktop) is that Ctrl-Alt-Left Arrow/Ctrl-Alt-Right Arrow combinations are not sent to your virtual machine
There are two workarounds:
My first soultion (change combination see below)
You can use AutoHotKey script as stated in thread:
https://superuser.com/questions/327866/remote-desktop-sending-ctrl-alt-left-arrow-ctrl-alt-right-arrow-to-the-remote-p
[/EDIT]
Reason is
duplication of the same hotkeys which could be found in 'Shortcut currently used by:' combobox
Fix is
I described process for _MoveRight shortcut - for other shortcuts it works the same
STEP 1 Check for conflicting changes
seeImage
go to Tool --> Options --> Keyboard
in field 'Show commands containing' find your command (moveright in example)
click in field 'Press shortcut keys' press ALT + RIGHT ARROW
in field Shortcut currently used by you will find conflicting shortcut -
Edit.CompleteWord...
STEP 2 Now we need to delete this shortcut
in field 'Show commands containing' write Edit.CompleteWord
you should see ALT + RIGHT ARROW shortcut in field 'Shortcuts for selected command
click Remove button
STEP 3 Now we need to add our shortcut to _MoveRight function
in field 'Show commands containing' find your command (moveright in example)
click in field 'Press shortcut keys' press ALT + RIGHT ARROW
click Assign

Visual Studio 2010 keyboard shortcut for next reference in C++

In VS2010 (C++) when I use Shift-F12 to invoke Edit.FindAllReferences(), I expect the F8 key to jump my cursor to the next found reference. It did on my old machine, but I just got a new one and now it does not.
Is there a different keyboard shortcut, or better yet, what is the command to jump the cursor to the next Find Symbol Results item?
(Yes, I tried Google... best I could find is F8 for when you invoke a Find All, and in the case of Find All, it does work, but I want "Find All References". I wouldn't have expected a difference...)
Thanks,
Karl
The F8 works on mine. Did you check your keyboard mappings. The default keyboard may have been setup differently (at install, there are choices like VC++2, VC++6, etc...)
Open Tools/Options Menu
Choose environment/keyboard on the left
On the Options dialog, find the "Press shortcut keys:" text box. Put your cursor in that box and press the F8 key.
Just below it in the Shortcut currently used by: "Edit.GoToNextLocation(F8 (Global)).
If it doesn't say that, you may want to change your default keyboard mapping scheme.

Is there a keyboard shortcut to move the cursor between methods in Visual Studio 2010?

Is there any keyboard shortcut to move the cursor between methods in Visual Studio? Is there any plugins that can do the same job?
All the time when I program, I want to go at the end of the current method and if I could have a shortcut that can move the cursor at the beginning of the next method and then just have to type a couple of up arrow to be where I want would be fantastic.
Thank you.
Note: For VS <2015, the following works only for the VB.NET code editor. In VS 2015+, apparently the C# code editor is also supported.
While there are no default keyboard bindings to jump between methods, you can set them up yourself:
Go to Tools → Customize…, then Keyboard…, and do the following:
Search for the commands by typing Method in the input line at the top.
Locate the two commands Edit.NextMethod and Edit.PreviousMethod.
For each of these, select the command first, then move the input focus to the input field Press shortcut keys, enter an unassigned key combination, and press the Assign button.
(The screenshot above shows that I have previously assigned one of these commands to Ctrl+Shift+<.)
Hi another (cheaper) alternative might be the CTRL+M+M to collapse/expand the current method to it's definition, allowing you to quickly navigate to the next.
Also CTRL+M+O to collapse all members is useful, with CTRL+M+L to expand all again.
Visual Studio doesn't have such a function, but JetBrains' ReSharper does. At least is the only one that I know of to offer this functionality.
For ReSharper the shortcuts are Alt-Up and Alt-Down, for previous/next member.
Try CTRL + ALT + UP. This first takes you to the scope selector where you can select a class if applicable, then press TAB which takes you to the method selector where you can select a method from the selected scope.
Note I use In Visual Studio 2012, don't know if works in other versions.
Jason Malinowski is right on his comment. It even says the shortcut keys are Ctrl+Down Arrow and Ctrl+Up Arrow. I used to use this all the time in VB6, but when I tried it lately using recent versions of visual studio, it didn't work; it would just scroll the edit window up or down one line.
When I went into Tools -> Options, select "Environment" on the left, and then the subcategory of "Keyboard", then type "Edit.ScrollLineDown" it said Ctrl+Down Arrow. When I removed this shortcut (and the one for ScrollLineUp), the next/previous method shortcuts then worked! I'm personally very happy about this.
Obviously, if you can find the right command, you can customize your keyboard shortcuts any way you please here.
I know this is old, but looks like it was added since.
Try Alt+[ or Alt+]
In Visual Studio 2013 with the commercial Visual Assist expansion you can use ALT+M to open a list with all methods in the current file. Select one, hit ENTER and the cursor will jump to it.
do not forget about the excellent, free DPack extension, which will add Alt+m shortcut which will open a list of all methods in the current class. You can type a search string to filter, and what is also great is if you tab down and enter on a method, and then later do Alt+m again, if you tab into the window you will be on the last method you selected. DPack also has many more features, like bookmarks, but I do find that you have to setup the hotkeys, or more exactly, re-assign hotkeys from other functions to DPack: https://marketplace.visualstudio.com/items?itemName=SergeyM.DPack-16348
Its Ctrl + } - by placing the cursot to end of line - using studio 2015
Same will also bring the cursor back to bottom.
so place the cursor at end of function and press Ctrl + }
In Visual Studio 2015:
Alt + Up or Alt + Down

Is there a hotkey in Visual Studio to open the member drop down list?

In Visual Studio there is a drop down list in the top right hand corner that you can use to navigate to the various members in the class. Does anyone know if there is a hot key to open this ddl?
I think you're looking for Ctrl + F2, which moves the cursor to the navigation bar at the top of a code view. From there, you can press Tab to move the cursor over to the member list.
For this (and pretty much every other Visual Studio hotkey/shortcut key combination), see here.
Visual Studio 2017+: They now support Resharper-like shortcuts. They work pretty well, too.
Ctrl+T - 'Go to All' (class/member/file), type m MyProp for members only
Alt+\ - 'Go to Member in current file'
Using VS 2008, I still don't know how to get directly to the Members dropdown which is what I want. But, the key bindings will be different for everyone. The command you want to search for under Options > Keyboard > Show commands containing: is Window.MoveToNavigationBar.
Assuming you are using the default keybindings packaged with Visual Studio, CTRL+F2 will focus the top-right drop-down list, and you can then navigate members by pressing TAB and using the arrow keys.
In my install of VS 2013, this is called Window.MoveToNaviationBar and is bound to Ctrl+F8. This is visual C++ settings.
Use Ctrl + F2 to get up there, then a click on Tab will get you to the member list instead of the object list.

Resources