VS 2010 keyboard shortcut list - visual-studio-2010

Is there a way to get a list of all of the keyboard shortcuts that are currently set in VisualStudio? This would be a lot easier than surfing through all of the commands in the options window.

Here's an example of one site that lists a good number of the short cut keys. I'm sure there are others.
http://www.dofactory.com/ShortCutKeys/ShortCutKeys.aspx
If you want to check the current bindings, there are articles about explaining how to do that:
http://msdn.microsoft.com/en-us/library/ms247076(v=VS.100).aspx
Note: This took me about 12 seconds to google...

I'm using PowerConsole - extension that integrates Powershell console to Visual Studio. To get a list of all shortcuts, you would type following command in PowerConsole:
PS> $dte.Commands | ? { $_.Bindings } | % { Write-host $_.LocalizedName ';' $_.Bindings }
The result is a list of command names and corresponding keyboard shortcuts (semicolon separated), that you could, for example, export to Excel, and if you want to print out

Here is the "official" list from Microsoft of all the default bindings in 2010. Has C++, VB.NET, C# and F#
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=92ced922-d505-457a-8c9c-84036160639f

Related

How does Visual Studio's UnderWare Brief commands emulation compare to Emacs and normal Edit?

Visual Studio (the full-fat version, not Visual Studio Code) and SQL Server Management Studio both feature editing commands that emulate (replicate? reimplement?) UnderWare Brief and Emacs (but not Vim, hmpf!)
In the IDE's Tools > Options > Keyboard Shortcuts window, the Brief-emulation commands have the prefix Edit.Brief... and the Emacs-emulation commands have the prefix Edit.Emacs...:
I was setting up some custom shortcuts of mine (as I like to bind Ctrl+E to Edit.LineDelete and Ctrl+D to Edit.Duplicate), and I noticed that the IDE has seemingly duplicate functionality from the Brief and Emacs emulation commands, which made me wonder what the difference was.
Unfortunately there's no documentation available online that describes exactly how each Edit.* command differs from each other - I know I could dive through VS' editor's DLLs to try to find out but before losing a weekend down a rabbit-hole I thought to ask first...
So, can someone explain the differences between these similarly-named commands?
Normal
UnderWare Brief
Emacs
Edit.BreakLine
Edit.BriefBreakLine
Edit.EmacsBreakLine
Edit.LineDelete
Edit.BriefLineDelete
Edit.DeleteToEOL
Edit.BriefLineDeleteToEnd
Edit.EmacsDeleteToEOL
Edit.DeleteToBOL
Edit.BriefLineDeleteToStart
Edit.Find
Edit.BriefFind
Edit.Replace
Edit.BriefFindReplace
Edit.EmacsFindReplace
Edit.WordDeleteToEnd
Edit.BriefWordDeleteToEnd
Edit.EmacsWordDeleteToEnd
Edit.WordDeleteToStart
Edit.BriefWordDeleteToStart
Edit.EmacsWordDeleteToStart
Edit.WordPrevious
Edit.BriefWordLeft
Edit.EmacsWordPrevious
Edit.WordNext
Edit.BriefWordRight
Edit.EmacsWordNext
Additionally, what exactly does Edit.WordNextExtend and Edit.WordNextExtendColumn do?

Visual Studio debugger - Displaying integer values in Binary

I'm using Visual Studio 2017 and I need to look at the binary representation of integer variables.
How can this be achieved from the Visual Studio debugger?
Type 'var, b' in the watch, for example:
According to the Visual Studio debugger documentation:
You can change the format in which a value is displayed in the Watch, Autos, and Locals windows by using format specifiers.
This note on debugging engine updates and compatibility is also worth noting:
When the Visual Studio native debugger changed to a new debugging engine, some new format specifiers were added and some old ones were removed. The older debugger is still used when you do interop (mixed native and managed) debugging with C++/CLI.
Although it mentions it can be applied to Autos and Locals windows, it is unclear how it is done as the variable names cannot be edited in those windows.
A <variable>, <format> syntax may be used in Watch and Immediate windows, like so:
Here is a direct link to the complete list of format specifiers.
Right-click the value it’ll show a menu list, but it only give us the option of Hexadecimal Display.
To display the variable with binary value in watch window, I suggest you write function to covert it :
The function that in my code is:
public static string ToBinaryString(uint num)
{
return Convert.ToString(num, 2).PadLeft(32, '0');
}

How to change window title of console application Visual Studio

In Visual Studio i have a console application, however the title always shows as [I think this is debugging specific, question still stands though]:
file://C:/Users......Service.exe
We spin up about 12 differently named processes locally and it's a huge pain to find a single one because the paths are so long they only tend to show the first letter or so of the actual process. We have resorted to hovering over them on the taskbar to see the full path. So my question is how do we go from the above (and example below) to something like:
Service
Example -
If you're using C#, use Console.Title and the string methods like trim or whatever.

Search Value in VS2010 Debug Locals and/or expand all Nodes

does someone might know how to search for a value in the locals
in visual studio 2010
or at least how can I expand all nodes, subnodes?
if you record a macro on activating locals tools window on VS2010 it will generated this line of code,
DTE.Windows.Item(EnvDTE.Constants.vsWindowKindLocals).Activate()
after debugging this code and inspecting DTE.Windows'ActiveWindow when the active window is local I unfortunately couldn't find anything helpful, but give it a try and you may find sth helpful
if you just need parameters of a method you can use MethodBase.GetCurrentMethod() in System.Reflection namespace and it will serve you well by this private memeber
((System.Reflection.RuntimeMethodInfo)(currentMethod)).m_parameters
that you can read programmatically by reflection or just quick watch it
There are several items here that would let you do what you need, but you'll likely have to tweak the code first:
http://www.codeproject.com/info/search.aspx?artkw=quickwatch&sbo=kw

Is there something like Emacs' toggle-read-only in Visual Studio?

The subject says it all. Is there an easy way to toggle the editability of a buffer in Visual Studio? This would be similar to the toggle-read-only command in Emacs.
I am not looking to change the file attribute ... just whether I can edit the file while it is open in Visual Studio. I am using 2008 and 2005.
Why would I want to do this? I tend to have several files open at the same time .... for days at a time sometimes (perhaps a bad habit) and I have +/- a char or few here and there without meaning to or noticing ... also worried about "the cat walking across the keyboard"
Besides ... an "ancient" code editor like emacs has it :) and I grew to expect the feature.
TIA!
There is an extension for Visual Studio called CodeMaid that will give you a Read-Only Toggle per file.
http://www.codemaid.net/documentation/#andmore
You can download it at http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496
You can use this piece of vba
Public Sub ToggleReadOnly()
Dim doc As Document
doc = DTE.ActiveDocument
If (doc.ReadOnly) Then
doc.ReadOnly = False
Else
doc.ReadOnly = True
End If
End Sub
Note: the msdn documentation specifically mentions that the property ReadOnly shouldn't' be used explicit but I verified that this works for me on vs.net 2005.
I also verified that the actual file attribute isn't changed.
I'm not aware of anything that will quickly achieve what you're looking for. Furthermore, I'm not really sure why you would need such a thing. Typically I use subversion to tell me which files have been changed and where they have been modified that way I can revert anything that doesn't belong.
Can you expand on your question a little to let us know what your usecase is?
If you really need to toggle readonly....perhaps you can:
Right click on the file
Select Open Containing Folder
Right click on the file and choose properties
Check the readonly checkbox
Start Tools->Macros->Macro IDE. Add new module (described here in details) and define there procedure as follows:
Imports EnvDTE
Public Sub SwitchReadOnly()
DTE.ActiveDocument.ReadOnly = Not DTE.ActiveDocument.ReadOnly
End Sub
Assign macro to keyboard key(described here in details). That's all.

Resources