Ctrl+' (Apostrophe) Refactor! binding doesn't work when Notepad++ is open? - visual-studio-2010

This is a really odd one that has been annoying me for some time, I use CodeRush and Refactor Pro at home and at work, since the switch to Visual Studio 2010 I have been unable to use the keyboard shortcut (Ctrl+') for the Refactor/CodeRush context menu:
For a long time I blamed VS2010 or CodeRush/Refactor! Pro for the issue and just worked round it with the mouse. At some point in time I realised that if Notepad++ was open the shortcut key didn't work.
Depending on what type of file is loaded in Notepad++ alters the effect; for example, if I have an XML/HTML/XAML file open a tag and all of it's children are removed.

I have just tried Notepad++ v5.8.6 with some source files opened and IDETools 10.2.4 in Visual Studio 2010, Windows 7 and everything seems to work fine - the CTRL+' shortcut works as expected. Probably you might want to change the shortcut to something similar like CTRL+1 in the DevExpress\Options\IDE\Shortcuts options page.

Related

Viewing binary files in MSVS under Windows 10

For ages I've been using MS visual studio 15 to view binary files, simply by doing file|open. My files have a custom extension, 'SQ3', but VS seemed to happily infer that they aren't text, and display them as binary. However, Win10 seems to have stopped that. Now if I do the same thing, a popup appears, asking me whether I want to find an application from the shop, or always use this application (presumably MSVS, the one I'm invoking from). There's a proceed button, but it doesn't respond. There seems to be no way that I can get VS to open and display the file.
Is there a way to stop the OS intervening so VS can do its thing?
Incidentally, having to rename files would be extremely inconvenient in this situation. TIA
Thanks, that's perfect.
In Visual Studio go to Tools/Options/Text Editor/File Extensions.
Add new entry to the list:
Extension: sq3
Editor: Binary Editor
Click Add and then OK to close the dialog. Files with .sq3 extension will now open with the hex editor when opening them or dragging them to Visual Studio.

How do you switch focus directly to docked windows in visual studio?

As a vim user, I am used to being able to switch the focus to different windows that are side by side with Ctrl-W [hjkl]. While Visual Studio offers very nice organization using docked windows, I find that using the Ctrl-Tab navigation window disorienting when all I want to do is switch focus to the pane that is to the left or right of the one I'm currently using.
Is there any good way to switch focus in Visual Studio between open windows?
I am using Visual Studio 2012.
As a (Vs)Vim-mer I am also looking for that essential feature.
Yesterday my VS2013 was behaving strange, but today it is working fine again (don't know what happened), i.e.:
When you have enabled VsVim Handling for ctrl+w in
Tools/Options/VsVim/Keyboard
then Visual Studio behaves like gVim.
If it happens that Visual Studio does not behave as expected (like yesterday ;-)) then you may alternatively use the similar shortcut:
ctrl+F6 which is assigned to Window.NextDocumentWindow.
This is quite sufficient to switch between both panes. If you hold the ctrl key down and typing F6 another time then it switches to another window, so release the ctrl key when having switched the pane.
You may add / change to another shortcut for this command via the Environment/Keyboard Option.

How Can I Paste Text From Another Application Into Visual Studio with Emacs Emulation Extension?

After copying text from another program, when I switch to Visual Studio with the Emacs Emulation extension and try to paste the text, none of the following methods work:
Ctrl-Y (Emacs emulation extension keybinding for 'yank' [paste])
Clicking paste on the toolbar
Edit > Paste
Right click > paste
How can I paste text from an outside application into a copy of Visual Studio that is running the Emacs Emulation extension?
As above - Ctrl-Shift-Ins (Edit.CycleClipboardRing) does work for this (at least it does for me having got the emacs add-in to load in VS2012,) so you can then go into Tools->Options, select Environment->Keyboard, and remove the Ctrl-Y shortcut, then assign Ctrl-Y to Edit.CycleClipboardRing.
Repeating Ctrl-Y does cycle the clipboard ring, which is a side-effect I can live with... I guess if you reassign Alt-Y to be the same command then generally this will do what you expect.
Ctrl-Shift-Ins (Edit.CycleClipboardRing) will paste the contents of the Windows clipboard into Visual Studio.
As far as the other, more standard methods not working, this is a known bug in the Emacs Emulation extension. From the extension's Visual Studio Gallery page:
Cut/copy/paste from other applications into Visual Studio does not work with the Emacs extension installed. We're working on a fix for this issue and will post an updated version of the extension when a fix is available.

Backspace doesn't work in Visual Studio

I keep getting a very annoying problem in Visual Studio. When I try to delete some text by pressing backspace it doesn't work. Why is this? What is going on? Sometimes I have to close and open Visual Studio to make this problem go away but I just tried that right now and it didn't work. Backspace works in Notepad in case you are wondering.
In Visual Studio go to:
Tools
Options
Environment
Keyboard
Find "Edit.DeleteBackwards" command.
In "Use new shortcut in:" dropdown select "Text Editor".
In "Press shortcut keys:" click backspace so it would show "Bkspce"
Click "OK".
Backspace should start working for you again.
This seems to happen to me when I open a solution and there are files already open. I used to close the files, then close and re-open the solution to fix it, but now I just hit Alt + Enter.
Here is the blog where I found this trick.
I solved this issue resetting keyboard mapping scheme.
Tools -> Options -> Environment -> Keyboard -> Reset.
A quick fix for me is to simply open any menu from the menu bar. Once the menu is closed the non-character keys start to work again.
Except for the above methods.
You should also check the shortcut key settings:
File -> Preferences -> Keyboard Shortcuts -> 'Then check the item: deleteLeft'.
I get this from time to time in VS2010 as well and simply just using the mouse to change tabs/files seems to always fix it now. Nothing more.
This method is working at 100%.
Go to "File-> Preferences -> Keyboard Shortcuts" and search for deleteLeft and add keybinding "Backspace".
Odd that this is still an issue even in VS 2019. Both the backspace and delete keys didn't work. Quick fix, I just ran the project and it seemed to give it the kick it needed.
All I did was exit visual studio and restart it.None of the above options worked for me.
In my case the problem was the "When" Condition in "File-> Preferences -> Keyboard Shortcuts".
I removed "textInputFocus && !editorReadonly" and it works now as expected.
I'm looking forward to the side effects ;).
Try resetting your Visual Studio Settings
Go to :
All Program > Visual Studio 20xx > Visual Studio Tools
Run Developer Command Prompt for VS20xx as Administrator and this command:
devenv.exe /resetsettings
A quick work-around for me is locking the pc (Windows+L) and logging in again.
You can reset keyboard mapping scheme like this
Options => Environment => Keyboard then select (Default) in the comboBox and click Reset button and then Ok button to confirm
Visual studio 2019 : Keyboard mapping sheme
Tested in Visual Studio 2019
This problem happened for me when I used a different version of resharper at home and then took that project to my employment. Backspace works for me now after I deleted the bin and obj and resharper directories.
I have this problem after I install Vim, uninstall Vim Backspace works fine.
When this issue has happened to me, I've found that hitting delete or backspace is unresponsive only within a portion of my code. This portion happened to be some code that I've pasted in from the internet somewhere.
To fix this issue, I cut out the recently pasted problematic code and then pasted it into a text editor like Notepad++. Then copying and pasting that same code out of the text editor and back into Visual Studio fixed the problem.
Using Visual Studio Community 2019 (16.4.3)
I just searched this issue because I could click in my document, type, et cetera, but I could not use backspace, delete, ctrl+z, or the arrow keys.
Opening the "File" menu, I noticed the Save option referred to a different file. I checked that file and found that all of the keys that seemed not to work were actually editing that other file.
Switching between the file in half-focus and the file I intended to edit worked and, luckily, undo was able to fix the file I unknowingly butchered.
If you wound up here, check your "File" menu to make sure the correct file is referenced, since the fix is quick and easy to try.
Just had this exact issue (along with 'Enter', 'Ctrl+X', 'Ctrl+C', 'Ctrl+V', 'Ctrl+Z' keyboard mappings seemingly doing nothing) in the latest VS preview version below:
Microsoft Visual Studio Professional 2022 (64-bit) - Preview
Version 17.2.0 Preview 6.0
The fix for me was to move to another tab (I had multiple open) use the backspace key which worked fine, then move back to the original tab with which it wasn't working, save the file (as it had outstanding changes) and then I found backspace and all other shortcuts then worked!
I can only think that VS got in a locked (to keyboard mappings) state for that particular tab.
A few notes on this:
I knew it wasn't a keyboard issue as I was able to use those
keys/mappings fine in other apps.
I found closing and reopening VS didn't work.
Also resetting the keyboard mappings (through Options menu as others have described) didn't work.
I had multiple tabs open.
Resharper was disabled.
I just had this happen in one instance of Visual Studio 2022, caused by the debug settings editor window being open in another instance of Visual Studio 2022 in the background where I couldn't see it.
Closing that window resolved it.
I've had this issue for a long time. I'm not sure what causes it, but Alt + Enter works.
The extensions that I'm running include AnkhSVN, MySQL Tools, and Productivity Power Tools.

Navigating backward and forward with the mouse in Visual Studio 2008

My install of Visual Studio 2008 does not support IE style back and forward navigation withe the mouse in the C# code editor.
Searches show that multiple people have run into this problem but I have yet to find a correct solution.
There's even a VS add-in hack just to work around the "bug".
Any idea why this functionality fails for some users and how to fix it?
You can mitigate the problem by AutoHotKey tool (free, open source).
Let's assume your Visual Studio 2008 has these editor commands and their respective shortcuts:
View.NavigateBackward = Ctrl+-
View.NavigateForward = Ctrl+Shift+-
You should be able to verify these shortcuts in keyboard options. Verified? Let's proceed.
So will you be just fine if your mouse will send these keyboard shortcuts if the Visual Studio's main window is active?
Then install the tool and add the following two mappings:
XButton1::^-
XButton2::^+-
These correspond to above keyboard shortcuts: ^ = Ctrl, + = Shift, - = -
Using AutoHotKey icon in notification area, reload definition file you just updated. Now your mouse buttons should produce the above shortcuts. Test them.
If they work for you in Visual Studio editor, you can limit them only to Visual Studio main window, otherwise they work across the entire desktop:
SetTitleMatchMode, RegEx
#IfWinActive, .*- Microsoft Visual Studio
XButton1::^-
XButton2::^+-
#IfWinActive
Feel free to adjust title-matching regex if needed.
Do not forget to reload definitions file to apply any changes you made.
Bonus:
And here are some other handy operations if you are holding Shift or Ctrl:
(You have those mouse buttons, let's use them... for commands across the entire desktop.)
+XButton1::^c
+XButton2::^v
^XButton1::^x
^XButton2::^z
(Letters must be lowercase, because uppercase means Shift+letter.)
(And always make sure you are running AHK elevated (as administrator.))
Enjoy!
Visual Studio 2008 is an editor and the apps built in it can also be built in any later version such as Visual Studio 2015. Not trying to be flippant, but the fix is to move to a later version of Studio. If money is a factor look into the Community version. (See Free Dev Tools - Visual Studio Community 2015)

Resources