What is the shortcut key for Run to cursor - visual-studio

What is the shortcut key for Run to cursor in Visual Studio 2008?

The shortcut key is CTRL+F10.

The default is CTRL+F10 but it can be overridden. The place to find what your current shortcuts are and change them is
Tools
Customize...
Keyboard...
Show commands containing:
Debug.RunToCursor
or
Tools
Options
Environment
Keyboard
Show commands containing:
Debug.RunToCursor

While on debug mode click on 'Run' you will see 'Run to Line' there in-front of it there will be a short key give which is CTRL + R

You can first hit
Ctrl + Shift + P
Then type "> Run to Cursor"
if you click on "gear" icon on the right, you can double click and set the shortcut at your convenience.
Also you can c/p: #command:editor.debug.action.runToCursor

Related

Select to End/Beginning of Line in Visual Studio Code

In most editors (including Visual Studio proper), I can use Shift+End to select all of the text from the cursor location to the end of the current line, and Shift+Home to select all text up to the beginning of the line.
These shortcuts don't seem to work out-of-the box (at least, on the Mac version). Is there some way to enable this, perhaps with a plugin or a setting I'm missing?
Strange it should work out of the box. If not, go to File > Preferences > Keyboard Shortcuts and look for cursorEndSelect.
{"key": "shift+end", "command": "cursorEndSelect", "when": "editorTextFocus"}
I use following inbuilt shortcut (VSCode 1.39.2, MacOS 10.15)
⌘ Command + ⇧ Shift + → Right Arrow key combination
You can access keyboard shortcut reference here: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf
You can visit this link anytime from VS Code by navigating to
Help > Keyboard Shortcuts Reference
It now appears to be ⌘ Command + ⇧ Shift + ↓ Down Arrow
(MacOS Big Sur 11.6)
The way that I set up mine is to go to File > Preferences > Keyboard Shortcuts and look for cursorLineEnd and cursorLineStart. Set these to with your own shortcuts for jumping to the end and beginning of a line.

Resharper Ctrl + - opposite shortcut

Resharper provides a great feature: Jump to previous focused method.
This can be caused by Ctrl- shortcut
What is the opposite shortcut, jump to the next method?
In Visual Studio, go to Tools->Options...->Environment->Keyboard. In the box that says 'Press shortcut keys:' press Ctrl- and see what's in the 'Shortcut currently use by:' box. (Mine says View.NavigateBackward (Ctrl- (Global))). In the 'Show commands containing:' box type in 'View.Navigate' and you will see 'View.NavigateForward'. Select that and in the 'Shortcut for selected command: box will be the keyboard shortcut (On mine it's: CtrlShift-(Global))
Here is key combination ctrl+shift+-

What key shortcuts are to comment and uncomment code?

There were Ctrl+E+C (comment) and Ctrl+E+U (uncomment) in older versions, or Ctrl+K+C and Ctrl+K+U.
But in VS 2012, I can't see key shortcuts:
How to enable those shortcuts?
Keyboard accelerators are configurable. You can find out which keyboard accelerators are bound to a command in Tools -> Options on the Environment -> Keyboard page.
These commands are named Edit.CommentSelection and Edit.UncommentSelection.
(With my settings, these are bound to Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U. I would guess that these are the defaults, at least in the C++ defaults, but I don't know for sure. The best way to find out is to check your settings.)
You can also add the toolbar in Visual Studio to have the buttons available.
View > Toolbars > Text Editor
Use the keys CtrlK,C to comment out the line and CtrlK,U to uncomment the line.
From your screenshot it appears you have ReSharper installed.
Depending on the key binding options you chose when you installed it, some of your standard shortcuts may now be redirected to ReSharper commands. It's worth checking, for example Ctrl+E, C is used by R# for the code cleanup dialog.
This is how I did it,
Menu Tools → Options on the Environment → Keyboard window
One can alter the default shortcuts following the below steps
Select Edit.CommentSelection in the listbox
Click on "Remove" button
Select "Text Editor" option in the dropdown under "Use new shortcut in:"
Press your own shortcut in the textbox under "Press shortcut keys:"
Example: Pressing Ctrl+E and then C will give you Ctrl+E, C
Click on "Assign" button
Repeat the same for Edit.UnCommentSelection (Ctrl+E, U)
I went to menu: Tools → Options.
Environment → Keyboard.
Show command containing and searched: comment
I changed Edit.CommentSelection and assigned Ctrl+/ for commenting.
And I left Ctrl+K then U for the Edit.UncommentSelection.
These could be tweaked to the user's preference as to what key they would prefer for commenting/uncommenting.
"commentLine" is the name of function you are looking for. This function coment and uncoment with the same keybinding
Shift + alt + a
the command palette is great for finding shortcut keys.

Shift + Enter no longer adds a new line in Visual Studio

I installed the Visual Studio 2010 productivity power tools, and since then Shift + Enter does not add a new line in the text editor. I've tried disabling all of the productivity tools settings and even uninstalling the productivity power tools entirely, but Shift + Enter still does nothing. I can't find the setting for this.
How can I re-enable shift + enter to add a space (just like enter alone does)?
Go to Tools/Options/Environment/Keyboard.
Switch the "Use new shortcut in:" dropdown to "Text Editor".
Pick the Edit.BreakLine command.
In the Press shortcut keys edit pane press Shift+Enter.
From Options menu, select "Environment", then "Keyboard" that gives you the option of setting keyboard shortcuts. The one you want should be "Edit.BreakLine" - you can search for them. Selecting this, you can then add/remove assosciated shortcuts.
In new versions it was changed to Ctrl+Shift+Enter, And you easily can change it as sbi suggested
Try Ctrl + Shift + Enter to add a line bellow.
Ctrl + Enter will add a line above.

Keyboard shortcut for Show All Files

Has anyone found a keyboard shortcut for the "Show All Files" in the Solution Explorer ?
And a related question ... is there any tool that can show the keyboard shortcut for any operation you're doing in VS ?
Cheers,
SteveC.
There is none by default. But:
Go to Tools / Options / Environment / Keyboard.
In 'Show commands containing", type:
showall
Scrolling in the list of commands reveals: Project.ShowAllFiles.
Select it and type the shortcut you want in the "Press shortcut keys" edit box. I used Ctrl + Shift + A.
If what you type as shortcut already has an associated command, you will see it in the bottom of this dialog.
In Visual Studio 2013, use alt + p + o.

Resources