Visual Studio Keyboard Shortcut of quick watch (shift + F9) Not Working - visual-studio

My quick watch (shift + F9) shortcut suddenly is not working.
But its alternate keyboard chord Control + Alt + Q works fine.
And all other shortcut seems working fine. But quick watch is the only one that I currently found.
I have tried other shortcut with Shift or with F9 , no problem.
I am also using Resharper, is that affecting VS Shift F9?

If you have Snag-It installed on your machine, its global shortcuts may override application specific shortcuts in Visual Studio (or other apps).
See #nuri's answer here: Visual Studio 2010 QuickWatch window not visible for instructions and screen-shots to change the Snag-It settings.
In the meantime, just go into the Snag-It preferences, the HotKeys tab, and set the "Video capture start/pause/resume" hot key to something other than [Shift]-[F9]. For myself, I only use "Global capture", so I set everything else to "None".

You can try the following:
In TOOLS --> Options | Keyboard, make sure the right mapping scheme is selected (Visual C# 2005 for me) and click Reset and finally, Ok

Related

Keyboard shortcuts starting with Alt don't work in VS

Keyboard shortcuts which start with Alt (such as Peek Definition Alt+F12) stopped working on Visual Studio 2015.
When I press Alt key, those underscores appear under menu items (which is default behavior of windows) as shown on image
Other keyboard shortcuts such as F5, and all the ones starting with Ctrl are working properly.
I've found a lot of answers about keyboard shortcut conflicts after installing ReSharper, but I haven't installed it.
Any suggestions?
In my case it was Nvidia's "In-Game Overlay". In case you are running this software, try disabling this in the "Geforce Experience".
The image below shows where to do this:
After long troubleshoting and googling I've combined multiple things and it worked:
Updated the Visual Studio
Resetted keyboard layout with following steps:
2.1. Make sure you have no additional keyboard and displays connected (this could be optional step, but without this the solution was not
working for me)
2.2. From menu open "Tools" and select "Options"
2.3. From left side select "Environment" and click on "Keyboard"
2.4. Change the mapping scheme to "Default"
2.5. Click on "Reset" (You'll be promted something then click on "Yes") and OK
2.6. And now restart the application
Also by the way installed ReSharper and uninstalled (this also plays keyboard shortcuts of Visual Studio) and retried second step
DevExpress Coderush overrides some of the Alt key bindings which prevent Visual Studio using them (ie: Alt Left & Right).
They can be disabled selectively via Extensions -> CodeRush -> Options -> IDE -> Shortcuts -> untick Enabled on right.
I can confirm that it's due to GeForce Experience. Of course, not exactly GeForce Experience's fault since it's meant for gamers. After disabling the In-game overlay under Options (wheel), General, In-game Overlay, alt+F7 worked immediately.

Visual Studio: Shortcut to close window not working

I changed the shortcut to close a window to Ctrl+W and to close all windows to Ctrl+Shift+W. Close all windows works fine, but Ctrl+W selects the word currently under the cursor but does not close the window.
When I right-click a tab it say Ctrl+W is the shortcut to close it (And also Ctrl+S to save and Ctrl+Shift+W to close all). Why is only the close window shortcut not working?
In Visual Studio (VS 2015 in my case but it's similar down to VS 2010 at least) keyboard shortcuts may have a different meaning depending on the context in which they are executed.
Click Tools / Options / Environment / Keyboard to look up or define shortcuts (you already did that probably). What I called "context" is selected in the combobox labelled "Use new shortcut in:". Most likely you defined the shortcut in "Global" but you want it to work in "Text Editor". In the latter Ctrl+W selects the current word.
Redefine Ctrl+W for "Text Editor" and you should be fine.
I am using Visual Studio 2017 & Visual Studio 2019 and tried the answer from #TobiMcNamobi but it didn't work for me. After few such tries I got it work with below steps.
You should add it as Global shourtcut otherwise it will not work for Designer views.
Add CTRL+W as a Global shortcut for Window.CloseDocumentWindow
Remove the CTRL+W shortcut for Edit.SelectCurrentWord
In Visual Studio 2019 it is Ctrl-F4 by default to CloseDocumentWindow. The action is Window.CloseDocumentWindow. I know this is old but the accepted answer has you change the short-cut key instead. I would rather use the default option.
Tools -> Options -> Environment -> Keyboard
If you're ever unsure go to the path above and you will see the image above then you can click inside the box "Press shortcut key" at the bottom of the form and type the short cut key you're interested in and it will tell you if it is used and what it is currently used for.
You can also reference the docs
https://learn.microsoft.com/en-us/visualstudio/ide/default-keyboard-shortcuts-in-visual-studio?view=vs-2019
2021: For Visual Studio 2019:
See: https://gist.github.com/jpoehls/2030795#gistcomment-2335647
In my case, I had to existing assignments that I had to remove. Thereafter, I could use the hotkey.
In my case, the tabs were not closing because I am using Vim extension. I had to add the following lines to Vim settings:
"vim.handleKeys": {
"<C-w>": false
}
Just press Ctrl + , or Command + , for Mac users, search for Vim and go into Edit in settings.json as the following picture shows:
Screenshot
For Visual Studio 2022, make sure you also remove Ctrl+W from selectCurrentWord command.
In my VS Pro 2019, on Tools / Options / Environment / Keyboard, the first line offers using a premade keyboard mapping scheme, with a drop-down option for VSCode keyborad mapping theme.
I picked it and it seems to have adopted the keyboard shortcuts I was used to from working on VSCode, Ctrl+W included.
For those using linux with VSCode v1.56.2,
File --> Preferences --> Keyboard Shortcuts.
Search for View:Close Editor and as mentioned above, remove any keybinding that has the keybinding you want.

Visual Studio 2013 Debug keyboard shortcuts are not working

I just got a new computer with Windows 8 and installed Visual Studio 2013 on it and now I have an issue with debugger shortcuts - I run application in a debug mode and it breaks at the first break point but when I try going further line by line, F10 does not work from the keyboard - only VS Debug menu. Anything I am missing?
P.S. The issue was the function key. It needs to be turned on in order to use F keys
On Lenovo laptops, there is a shortcut to disable the Fn key automatically running the default Windows shortcuts.
Hit the Fn key and the Esc key at the same time to toggle the "Hot Key" default.
Hope this works for other Laptop brands since this is an easy shortcut for newer Lenovo laptops.
Please follow the instruction here, though it talks about visual studio 2010 it should help you to analyze the problem. it may be solved with the steps described there and if not, please let me know...
Why does F10 (step over) in Visual Studio 2010 not work?
Update Adding the answer from the source in case the link will be removed:
In the Options.Keyboard page, please select "Debug.StepOver" from the command listbox, and then put focus to the "Press shortcut keys" textbox and press F10, click Assign button to re-assign shortcut, does it work?
You can also try to run Visual Studio under safe mode, which will
prevents all third-party VSPackages from loading when Visual Studio
starts; if the issue disappear under safe mode, you may consider
checking your installed add-ons or VSPackages.
Second, to log all activity of Visual Studio to a log file for further
troubleshooting, please use the /Log switch, and post the log file
content here, so we can do more investigation on it.
If this feature works well before, and suddenly behave abnormally, it
usually indicate that some files or configurations of Visual Studio
installation is corrupted or missed, you can:
Restores Visual Studio default settings by using "Devenv.exe
/ResetSettings" command. Please backup your settings before restore to
default settings.
Repair/reinstall Visual Studio;
To repair Visual Studio In the Add or Remove Programs dialog box,
select Visual Studio then click Change/Remove.
I resolved my issue and wanted to post an answer in case anyone is looking for it. Enabling function key does not require any complicated solution, it can be enabled by changing settings in:
Control Panel -> Hardware and Sound (Category) -> Windows Mobility Center -> Adjust Commonly Used Mobility Settings
Look Under Function Key Behavior and change the dropdown value to "Function Key" to enable Fn key.
To disable it, select "Multimedia Key" 
See: http://elena-sqldba.blogspot.com/2015/05/how-to-enable-function-key-on-windows.html
Also check 3rd party software. In my case I had Camtasia Recorder open and minimized, which apparently intercepts the F10 input (thanks, TechSmith)
I had the same problem. My solution was a bit different and can apply to any key. My F10 key was not working. After unplugging the keyboard and plugging it back in did not fix the problem, I twisted the keyboard like an ice cube tray and the F10 key started working again.

What's the equivalent for eclipse's ALT+UP/DOWN (move line) in Visual Studio?

In Eclipse, selecting a line and pressing Alt + ↑/↓ will move the line up and down, a quick way to avoid copy&paste.
Is there an equivalent in Visual Studio?
In Visual Studio 2013 and later, this functionality is built in. ALT + UP/DOWN will move a line up or down.
If you need this functionality in VS2012 (works with VS2010 too), take a look at the MoveLine Visual Studio Extension or the Productivity Power Tools suite.
ReSharper's Ctrl + Shift + Alt + ↑/↓/←/→ is even more powerful - when on the beginning of the line, it will move the entire line, but can also be used to move entire methods, change the order of parameters, etc.
For me in Visual Studio 2019 it comes default closed.
For open it:
Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesUp, click "Press shortcut keys" input and press Alt + Up (or whatever you want for it). And the other one is Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down (or whatever you want for it).
This is now working out of the box with Visual Studio 2013, same way as in Eclipse.
For Visual Studio 2013:
Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down. You also have to select the scope of the shortcut to be within "Text Editor".
In Visual Studio 2013 and later, you can move lines up and down using Alt + ↑ / Alt + ↓. Unfortunately this will not adjust the indentation if you move between blocks, as of today only ReSharper (and all other IDE's by Jetbrains including Rider) can help you with that.
To move entire blocks of code around you can move the cursor to its head and press Ctrl + m twice fast to collapse it, and then use the command above to move it around.
Here is a neat reference to all default keyboard shortcuts in different versions of Visual Studio.
With the VSCommands extension, you have exactly that keyboard shortcut. And, by the way, a Stack OVerflow notification toolbar :)

Is there a keyboard shortcut to view all open documents in Visual Studio 2008

I am trying to learn the keyboard shortcuts in Visual Studio in order to be more productive. So I downloaded a document showing many of the default keybindings in Visual Basic when using the VS 2008 IDE from Microsoft.
When I tried what they say is the keyboard shortcut to view all open documents (CTRL + ALT + DOWN ARROW), I got a completely unexpected result on my XP machine; my entire screen display was flipped upside down!
Was this a prank by someone at Microsoft? I can't imagine what practical value this flipping of the screen would have.
Does anyone know what the correct keyboard shortcut is to view all open documents in VS 2008?
Oh and if you try the above shortcut and it flips your display the way it did mine, do a CTRL + ALT + UP ARROW to switch it back.
This is a conflict between your graphics driver and Visual Studio. Go to your driver settings page (Control panel) and disable the display rotation shortcuts. With this conflict removed, the shortcut will work in Visual Studio.

Resources