visual studio 2010 "surround with" hijacked by "pex and moles" - visual-studio-2010

After I installed "Pex and Moles", used for automated testing, my "Surround with" (ctrl + k, s) in Visual Studio 2010 has been "hijacked" by the new add on.
This means I can only choose to insert a "PexClass for MSTest", which is kind of annoying since I use surround with many times each day.
Hope someone can help to reset this feature to its original functionality without removeing Pex and Moles.

Open the menu Tools -> Options
Then select Environment -> Keyboard
In the shortcut field, press CTRL+K, S. You'll see all bindings for this combination. Adjust or remove the ones you don't like.

Related

Configure VS2015 Intellisense "accept" key [duplicate]

I would like Visual Studio to autocomplete the current entry in the intellisense menu only when I hit tab.
Autocompletion being triggered, for example, when I press a period, is forcing me to hit escape every time I'm writing something that cannot yet be autocompleted, to avoid that what I'm typing gets replaced with a random entry.
Is there an option to configure this?
I'm using Visual Studio 2015, and programming in C#.
Example: here I'm typing Log, which is a class for which I haven't yet added the appropriate using statement. None of the suggestions is the good one. If I hit . now, the autocomplete feature will write EventLogProcessor, which is not what I want.
Please note that this question has nothing to do with VIM, this is not a duplicate of the question linked at the top.
Use Toggle Between suggestion and Standard completion mode option of visual studio .. It will now only suggest .. and if you press Tab it will complete your choice ..
Edit -> IntelliSense -> Toggle
For Visual Studio 2012, from the Menu Bar,
Select Tools -> Options
In the left pane, expand Text Editor -> C#
Select InteliSense
The characters that commit are listed in a text box

How to replicate SublimeText ctrl+D in Visual Studio

I am used to work with Sublime text and trying to switch for Visual Studio for bigger projects, one of the feature of sublime that I absolutely love is its multiple select feature. You can hit ctrl + d multiple times to select next instance of the same word and then rewrite them all at once. Is there anything like this in Visual studio? I tryed to find it, but with no success.
Btw I am using Visual Studio 2015.
Visual studio 2017-19
The default shortcut is Alt+Shift+.
But if you want to add Ctrl+D
Go to the menu Tools > Options then select the Keyboard tab on the left
At the top you'll find an option to add extra keybindings, select Visual Studio Code. Save and That's it!
This works because Visual Studio Code has Ctrl+D, and other shortcuts similar to SublimeText
Alternatively you can manually add shortcuts
In the image, you can find any command to customize in the middle section.
The particular command you are interested is the one selected Edit.InsertNextMatchingCaret
Ctr R, R, this is used to replace the name of the varibals, depronto can serve it.
and you are encouraged here are all the shortcuts of vs2015 http://visualstudioshortcuts.com/2015/
Goto Tools / Options / Keyboard
Search for duplicate
Choose Edit.Duplicate
Remove the assignement for the current shortcut
Assign the shortcut you want
Ctrl + Shift + L seems to work.
Use Alt +leftClick and ctrl+F2 . For more reference you can go Official Website [link]https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-shortcuts-reference
I decided to use this Visual Studio Extension:
https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.SublimeVS

Can you turn off Peek Definition in Visual Studio 2013 and up?

In Visual Studio 2013 and up, there is the Peek Definition feature when you Ctrl + Click. At first I thought this was cool, but I have found that the majority of the time, I need to click the Promote to Document button, since I make lots of changes to the files I Ctrl + Click on. But after Googling how to turn off Peek Definition, I can't find any details on if this is possible. What I would really like is for the Ctrl + Click functionality to go back to opening the definition in its own tab, like in previous versions of VS. Is this possible?
In pre 2017 Visual Studio:
Tools→Options→Productivity Power Tools→Other Extensions→Control click shows definitions in Peek
Adam Garner pointed out that in Visual Studio 2017, the location is:
Tools→Options→Text Editor→General→Enable mouse click to perform Go to Definition
If you have Resharper AND Productivity Power Tools, by default this will cause ctrl + click to go to definition AND peek the definition. Very annoying. The solution from #SnowFatal will turn off the peek functionality. Resharper's option is listed as "Go to Declaration on <Control + Left Click> in the editor".
In the latest version of Visual Studio 2017 (15.4.0) it is:
Tools→Options→Text Editor→General→Enable mouse click to perform Go to Definition
You can either disable it by unchecking the box, or set a different key to trigger the mode.
Ctrl + Click -> Peek Definition is actually enabled by Productivity Power Tools. If you disable "Ctrl + Click Go To Definition" in Productivity Power Tools options then this behaviour will disappear.
For Visual Studio 2017 it is:
Tools→Options→Productivity Power Tools→General→Control click shows definitions in Peek

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 :)

How does one set Visual Studio 2010 keyboard shortcuts comfortably, especially when using ReSharper?

In every Visual Studio.NET version you can set keyboard shortcuts using menu Tools -> Options -> Environment -> Keyboard and then find the command you want to assign a shortcut to by entering part of it in "Show commands containing".
For one thing, the listbox is ridiculously short and hard to navigate - is there an alternative?
Then, how do I find out the correct command name for a specific action?
Specifically, I'm using ReSharper 5.1 with Visual Studio 2010 and want to have the Alt + Enter shortcut back (it used to be there in older versions by default) that opens the ReSharper context menu when the cursor is over a curly underline ReSharper uses to highlight errors or warnings.
How do I find out the command name for that (except by an educated guess)?
The way I do this is to perform an action while recording a macro (using Tools / Macro / Record temporary macro).
When I have finished with the action, I look at the source code of the macro and it usually helps to find the correct command.
For example, I have just let R# add some magic through Alt-Enter, and the macro recorder has:
DTE.ExecuteCommand("ReSharper_QuickFix")
You can rebind all of the ReSharper shortcuts by using the ReSharper -> Options -> Visual Studio Integration page. Select a keyboard scheme and hit "Apply Scheme".

Resources