Keyboard shortcut for Visual Studio/Resharper tooltips? - visual-studio

Is there a keyboard shortcut to display tooltips provided by Visual Studio & Resharper when you hover over a bit of code? I'm already aware of Quick Documentation (Ctrl + Q) and Quick Watch (Ctrl + Alt + Q).

Do you mean Ctrl + K, Ctrl + I? This is the command Edit.Quickinfo.
(sorry, I am unable to add a comment with the PC I have now)
For the single variable, do you mean in debug mode ?
2nd Edit: I think VS names these tooltips 'datatips'. Unfortunately, there is no command to show them, so no possible shortcut.

You can do it by binding this command to a key:
EditorContextMenus.CodeWindow.PinToSource
Unfortunately it works with what you have selected, not with what you are hovering over. Not only do you have to do the extra click, but you need to select the entire variable name and all of its prefixes as well.
Old question but useful to know.
My shortcuts:
PinToSource set to alt-F1
ClearAllDataTips set to shift-alt-F1

CTRL+ALT+Q
It is equivalent to
SHIFT+F9

Related

What is the keyboard shortcut for Code Rush three periods?

I know with ReSharper you can use the keyboard shortcut Alt + Enter to open the "quick tasks" or whatever it's called. Is there a similar keyboard shortcut for Code Rush?
Officially the answer is Ctrl + ` (Ctrl and back tick)
However in some scenarios this can set itself up as Ctrl + ' (Ctrl and single quote)
Note: I believe the reason for this comes down to codepages\keyboard layouts and other things I don't fully understand :)
The common shortcut to invoke code refactorings and fixes in CodeRush is the Ctrl + ` (backtick) key combination. This shortcut invokes the popup menu which lists all operations available for the current context.
It's configurable. Mark Miller recommends setting it to NumPad 0 so your pinky can hit it as needed - careful though - you'll get addicted!

Windows 7 Map CTRL + j to the Down Arrow Key

I have been searching for months for a way to map a key combination (CTRL + something) to a directional key (like down or up).
I desperately want in Visual Studio to be able to press CTRL + j and have the cursor move down a line. I hate having to move my hands off of the home row to move up and down for things like intellisense or even just navigating up and down lines.
Does anyone have a solution for this? I would be ok with a Visual Studio-only solution, but something that works at the OS level would be ideal since this kind of navigation would be nice in any editor window and for instance SQL Server Management Studio also has intellisense.
I haven't considered any macro hotkey type solutions since they could conflict with in-app hotkeys (for instance if CTRL+j were assigned to something in Visual Studio already)
I think the answer is nothing out there exists that would do this. I have done a lot of research.
I am now using Autohotkey instead of what would have been ideal. I have been familiar with this application for years and it does a pretty good job, but doesn't work across remote desktop for instance and so doesn't quite fill the need.
I mapped ctrl + i to do up, ctrl + k to be down, ctrl + j as left and ctrl + l for right.
VS-only solution is simple.
At least in Visual Studio 2017 you can assign Ctrl+XXX key combinations to corresponding commands for Text Editor.
CharLeft
CharLeftExtend
CharRight
CharRightExtend
LineUp
LineUpExtend
LineDown
LineDownExtend
PageUp
PageUpExtend
PageDown
PageDownExtend
LineStart
LineStartExtend
Delete
DeleteBackwards
WordPrevious
WordPreviousExtend
WordNext
WordNextExtend
and so on.
All using standard Tools / Options / Environment / Keyboard settings dialog.

Is there a way to delete a line in Visual Studio without cutting it?

I want to delete a line just like hitting Ctrl + X without anything selected, but without saving the line to the copy stack. Is this possible?
I'm using Visual Studio 2010.
Edit.LineDelete is the name of the command. By default it's bound to Ctrl + Shift + L, but you can give it whatever you like in Tools | Options | Keyboard.
Edit: Corrected default shortcut info.
Ctrl + Shift + L will delete the line and not copy to the clipboard.
I mapped Ctrl + L (Global) to Edit.LineDelete. Otherwise, the shortcut key is Ctrl + Shift + L, which is awkward. Go to Tools > Options > Environment > Keyboard as shown below.
Correction in my answer
Ubuntu 16 &
Visual studio Version: 1.30.1
To cut line
Shift + del
To delete line Shift + Ctrl + k
CTRL + L (Visual Studio 2019 Windows)
Its Cmd + Shift + K on mac by default.
But it can be modified according to user needs from the settings (Preferences -> Keyboard Shortcuts) -> search for Delete Line key value.
Valid Answer By 2022 for VS Code (with image)
All the above answers regarding Ctrl + Shift + L are now deprecated.
The correct default behavior is Ctrl + Shift + K
(⌘ + Shift + K if you're a MAC user).
To change this default behavior:
1- Go to File > Preferences > Keyboard Shortcuts (OR click Ctr+K Ctrl+S)
2- Type in the search bar delete line
Here you will find the corresponding behavior. You can change it just by double-clicking on it and pressing any desired combination of keys on your keyboard (pay attention of conflicting shortcuts).
By default, if you are using the C# default profile, you can delete a line using Ctrl + Shift + L.
You can customize this using Tools->Customize. Select "Keyboard". Look for the command Edit.LineDelete to assign it to whichever keyboard shortcut you like.
Source
If you got here looking for an answer for Visual Studio Code the default shortcut is:
ctrl + shift + K for Windows
⌘ + shift + K for MacOS
However, you can change on File > Preferences > Keyboard shortcuts
{
"key": "ctrl+shift+delete",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
}
Source
none of the above answers worked for me. to delete a line in visual studio code use :shift+del
All the answers were helpful but didn't seem to work for me.
So I found the solution --> for Visual Studio 2017 (and certainly 2019):
Tools > Options > Environment > Keyboard > on the right pane select Edit.LineEdit.
Below there is a ComboBox Use new shortcut in: with Global written --> Change it to Text Editor.
On the right there is a Text input Press shortcut keys:, so use the shortcut of your choice.
Then click on Assign PushButton on the right (otherwise it won't be applied).
Finally > OK.
You can now open a .CPP file and use your shortcut to remove a line.
On Visual Studio 2019 for Mac, it's CTRL + K to cut the whole line by default.
Here is a url for the keyboard short cut reference for windows:
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
For windows: Ctrl + Shift + k
The other answers are specific to Visual Studio, which is what was requested by OP, however if anyone is looking for a more generalized way to do this for most Windows programs, you can also Triple-Click to select any block of text, then just press the Delete key. This works for any Windows text editors or TextBoxes, including password boxes, search boxes, browser web address boxes, etc. For text editors such as Visual Studio, a block of text is typically one line of code. Obviously you can do other things too, such as triple-click to select a line of code, then Ctrl-X, Ctrl-V to cut/paste, etc, or just triple-click and type over it to replace a line.

Visual Studio 2010 Keyboard Shortcut Chords

I started out with VB6 default shortcuts where Ctrl + R brings up the Solution Explorer window.
Now when I hit Ctrl + R I see a status message saying that VS is waiting for me to hit the next sequence in the chord, suggesting to me that I have shortcuts that begin with Ctrl + R but require another keystroke.
This suggests to me that having one or more shortcut sequences that begin with Ctrl + Rinvalidates the Ctrl + R shortcut, which I can understand, but the question is, how do I find what those command are so I can assign a different sequence to them?
Also, shouldn't VS warn me when assigning the first chord shorcut that begins with Ctrl + R that this will invalidate my Ctrl + R shortcut or, it should clear it out so Ctrl + R is no longer a shortcut for the Solution Explorer window.
Anyway, I guess the question is how do I locate the commands that begin with Ctrl + R so I can change them so they dont collide with my Solution Explorer shortcut Ctrl + R?
In VS 2010, Tools | Options | Environment | Keyboard gets you to the right place. Now, put the cursor in Press shortcut keys, and press the keys you are interested in (so Ctrl + R). The Shortcut currently used by dropdown will then show you all the shortcuts that currently involve the keys you have pressed.
I agree it would be a 'nice to have' for VS to warn about overlapping shortcuts, but note that different shortcuts can have different scopes of effect (in the Use new shortcut in dropdown), so this might not be as easy as it sounds.
The keybindings poster from MSDN might be helpful. It looks Ctrl + R behaves differently depending on if you are debugging or not.
Have a look at IntelliCommand Plugin. This helped me out a lot in learning and remembering the chrod combinations.
Also Learn the shortcut Plugin is pretty cool too.

Visual Studio 2008 - jump to line number shortcut

I can go to a specific line number by double clicking in the status bar in Visual Studio. Is there a keyboard shortcut that does the same thing?
Ctrl + G
Check out all the keyboard shortcuts at:
http://www.microsoft.com/downloads/details.aspx?familyid=e5f902a8-5bb5-4cc6-907e-472809749973&displaylang=en
Ctrl + G works for me.
If it doesn't work for you, you can always map whatever shortcut you want under Tools | Options | Environment | Keyboard.
EDIT: Yes, as #Brian mentions, the command in this case is Edit.GoTo
I just realised that the default in C# settings for this command is Ctrl + G, whereas in VB Settings, there is no default keyboard short - it's mapped to show the immediate window - strange I think. I swapped the mappings so that the two environment behave the same.
Every IDE or even text editor I have ever used either uses Ctrl + L or Ctrl + G for this purpose.
I assume this could stand for Ctrl + Line or Ctrl + Goto
Yep Ctrl + G.
From this answer you can get a nice Shortcut poster.

Resources