Ctrl+Shift+Right arrow doesn't work in Visual Studio 2019 - visual-studio

I can't select words to the right by using the standard shortcut Ctrl+Shift+Right arrow.
By the way, words selection to the left with Ctrl+Shift+Left arrow works well.
Probably, the ReSharper keyboard layout creates this trouble.

I fixed this in Visual Studio 2019 in the Tools > Options window.
Select Environment > Keyboard and paste Edit.WordNextExtend into the "Show commands containing" field.
Then proceed as shown by the red arrows in the following image.

Related

In Visual Studio, what is the keyboard shortcut and Command ID to "search/query everything box"

In Visual Studio 2021 or above what is the keyboard shortcut (KeyMap) Command ID to the "search everything box"? This box is displayed top right of IDE menu bar. It offers a global search including, IDE actions, menus, commands and symbols within code.
The default Ctrl+Q is NOT assigned on my config, used for something else.
Please see the screenshot:
Could not find the correct command in KeyMap. For information, in JetBrains Rider, this command is called "Search Everywhere".
On my installation of VS 2022 the placeholder text within the search box is "Search (Ctrl+Q)".
Pressing this shortcut in the keyboard mappings yields the Shortcut Window.QuickLaunch
The page you linked to also shows this is the default settings for Window.QuickLaunch.
According to Visual Studio documentation
Use the Ctrl+Q keyboard shortcut to access the search box
Advance Shortcuts:
The search results include tabs for All, Code, Visual Studio. You can save time by using the following keyboard shortcuts for different types of searches:
Ctrl+Q, Ctrl+T for files, types, and members
Ctrl+Q, Ctrl+M for Visual Studio menus, options, components, and templates
Ctrl+Q, Ctrl+E to go to the All tab, for both
Please try with Ctrl+Q it is working fine in visual studio 2022.

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.

Shortcut key to Toggle Results Pane SQL Editor Visual Studio 2012

In Visual Studio 2012, I'm trying to use Ctrl+R and it is not hiding results pane in SQL Editor window.
Ctrl+D, R.
Do notice that it is NOT Ctrl+D, Ctrl+R, i.e. you will have to lift your finger from Ctrl key when you press R
Go to Tools > Options > Environment > Keyboard / General.

Show space, tab, CRLF characters in editor of Visual Studio

Where are the settings to show a space, tab, paragraph, CRLF, etc. (extended) characters?
Edit > Advanced > View White Space. The keyboard shortcut is CTRL+R, CTRL+W. The command is called Edit.ViewWhiteSpace.
It works in all Visual Studio versions at least since Visual Studio 2010, the current one being Visual Studio 2019 (at time of writing). In Visual Studio 2013, you can also use CTRL+E, S or CTRL+E, CTRL+S.
By default, end of line markers are not visualized. This functionality is provided by the End of the Line extension.
Edit -> Advanced -> View White Space or Ctrl+R,Ctrl+W for Visual Studio 2019
Display white space characters
Menu:
You can toggle the visibility of the white space characters from the menu:
Edit > Advanced > View White Space.
Button:
If you want to add the button to a toolbar, it is called Toggle Visual Space in the command category "Edit".
The actual command name is: Edit.ViewWhiteSpace.
Keyboard Shortcut:
In Visual Studio 2015, 2017 and 2019 the default keyboard shortcut still is CTRL+R, CTRL+W
Type one after the other.
All default shortcuts
End-of-line characters
Extension:
There is a minimal extension adding the displaying of end-of-line characters (LF and CR) to the visual white space mode, as you would expect. Additionally it supplies buttons and short-cuts to modify all line-endings in a document, or a selection.
VisualStudio gallery: End of the Line
Note: Since Visual Studio 2017 there is no option in the File-menu called Advanced Save Options. Changing the encoding and line-endings for a file can be done using Save File As ... and clicking the down-arrow on the right side of the save-button. This shows the option Save with Encoding. You'll be asked permission to overwrite the current file.
My problem was hitting CTRL+F and space
This marked all spaces brown. Spent 10 minutes to "turn it off" :P
The correct shortcut is CTRL-R-W like you don't have to release CTRL button while pressing W. This worked for me in VS 2015
For those who are looking for a button toggle:
The name of this command is View white space in GUI menu (Edit -> Advanced -> View white space).
The name of this command in the Add command popup is Toggle Visual Space.
If you use Visual Studio Code => View => Render Whitespace
That's it!
For me this setting was on, but didn't work. I had to turn it off and on again and than it worked! So this is a bug in Visual Studio Code!
If you use Visual Studio 2022 you can change the display options for whitespace etc. in Tools => Options => Text Editor => General and select "View whitespace"
The shortcut didn't work for me in Visual Studio 2015, also it was not in the edit menu.
Download and install the Productivity Power Tools for VS2015 and than you can find these options in the edit > advanced menu.
To see the CRLF you can try this extension: End of the Line
It works for VS2012+
For Visual Studio for mac, you can find it under Visual Studio -> Preferences -> Text Editor -> Markers and Rulers -> Show invisible characters
Please note you may need to restart Visual Studio for the changes to take effect
For completeness since I haven't seen it mentioned here, it is also in Options->Text Editor->General->View Whitespace.
In the actual version this Option ist under Editor: Render Whitespace

How to maximize Visual Studio panels?

Is there a way to quickly maximize (and then restore) Visual Studio 2010 panels? For instance, I'd like to temporarily maximize the Output window or unit test results window. In Eclipse, I would just double-click the window tab, but in VS, this undocks the window.
The desired behavior is: double-click to maximize the window, then double-click it again to restore the panel to its original position.
Use this keyboard shortcut: Shift-Alt-Enter
It will maximize your current panel similar to Eclipse, but it will use the full screen unfortunately, not just the whole Visual Studio window. I prefer the way Eclipse does it, but this does help in Visual Studio land.
This feature has been added to Visual Studio Productivity Power Tools 2013 ("Double click to maximize windows"), which is free to download.
This new feature allows double-clicking any window tab to maximize it to full-screen mode and restore it back to its initial docked state - without having to worry about float operations or changes to your window layout.
In Visual Studio 2010, you can double-click the title bar of a given panel to put it into float mode, then use it just like any other window (maximize, Windows 7 dock, etc.). Ctrl-double-clicking it again will turn it back into a docked panel.
You can also right-click on the title bar and select Dock as Tabbed Document to display the panel in the same way the code windows are displayed.
In Visual Studio 2017, on a focused tab
Alt + -, F
Alt + Space, X (see UPDATE)
UPDATE (Windows 10)
Win + Up
From the View menu, pick Full Screen menuitem.
Note: when you select the View menu, you will notice that the shortcut for selecting Full Screen is mentioned, Shift+Alt+Enter (which was mentioned previously in the Answers).
Platform: Visual Studio Professional 2017, Version 15.5.7 on Windows 10, 64-bit
Closest the Eclipse behavior is to follow these steps:
Right-click the window title bar, select Float
Double-click the window title to maximize
Right-click the window title, select Dock
After these steps, double-clicking and Ctrl+double-clicking the window maximizes / restores itself
Here it is as a key board shortcut for commando types:
Ctrl+Tab Switch to your desired window/panel.
Alt+- Show the dock menu.
T Choose 'Dock as tabbed document'
Right click title bar, then choose 'float', it will only get that window, not the whole panel. Then double-click to maximize.
Also, the commands are
Window.Float
Window.Dock
and you can assign them keyboard shortcuts under tools\options. So for example I mapped them to Ctrl-Shift-F7 and Ctrl-Shift-F8, and then after once maximizing the Output window, henceforth if I have the output window docked, I just focus it and then a key makes it big and other puts it back, hurray.
If you have already installed Productivity Power Tools 2017 (PPT), and the double click file tab is not working or any other feature in PPT, just reset the PPT and it should work just fine after restarting visual studio 2017.

Resources