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

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.

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.

Change Ctrl+Click Behavior in VS Output Window

Is there a way to change how links are opened from the Output Window (not an Editor)?
Meaning, when the Output Windows detects a link, it's Ctrl+Click-able and opens in an Internet Explorer tab.
I'd like to change the target from IE to the Text Editor and still within Visual Studio.
There are solutions for changing the click behavior in an Editor, but I am asking specifically about the Output Window. I understand the answer might just be no.
There's a Visual Studio Extension that lets you open URIs in the browser (https://visualstudiogallery.msdn.microsoft.com/46c0c49e-f825-454b-9f6a-48b216797eb5).
I've forked it and made some updates so that it will handle file:/// URIs as well, opening them in the Visual Studio editor or an external editor. I've published a debug version that hasn't been very heavily tested here. You can peruse the full source of my fork here, or the original source here.
This makes debugging/working with the BizTalk map/schema tools a lot better...

Using the command line from within Visual Studio

I'd like to have a tool window in Visual Studio that allows me to type command line things (e.g. git stash, npm install, etc.) in the current project's working directory. Something like this in Eclipse.
I can't find any such option in any of the menus, but admittedly they're labyrinthine. I tried looking through the Visual Studio gallery, but no dice either. Any extension or hidden option that would give me this?
PowerShell would probably also work, as from what I understand that's a superset of the regular shell.
In Visual Studio 11, the NuGet Package Manager Console is a fully featured PowerShell console. You can do all kinds of things there, including file system operations, git/hg/svn/tfs commands, etc.
You also can customize the experience with a special PowerShell profile called NuGet_profile.ps1.
Installing the NuGet VSIX from the Visual Studio gallery will get you a similar experience in VS2010 if I'm not mistaken.
For anyone that comes across this in 2018+, there is now also the Whack Whack Terminal extension from Microsoft's Daniel Griffen (#dgriffen on GitHub), which gives you exactly what you were looking for.
Whack Whack Terminal is a terminal emulator for Visual Studio 2017. Unlike other terminals for VS, Whack Whack Terminal is fully interactive. Users can launch interactive git commits, vim, or almost any other command line utility.
The default terminal is powershell and it can be opened with the shortcut chord "Ctrl+\, Ctrl+\".
CMD and WSLBash are also available terminal choices.
It's also open source! You can find the source code at Microsoft/WhackWhackTerminal on GitHub.
There is a command window in Visual Studio (CTRL + ALT + A) or (View -> OtherWindows -> Command Window)
You can then use the shell command to run external executables
The syntax is:
shell [/command] [/output] [/dir:folder] path [args]
You can download PowerConsole from the Visual Studio extensions gallery.

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

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.

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