14

I am trying to follow the below StackOverflow question to get Emacs in Visual Studio Community but have had no success.

Emacs Keybindings in Visual Studio 2012 or 2013

I was able to get to step 5) from the above question's best answer: "execute start emacsemulations.vsix from the administrator command prompt"

However, I get: "This extension is not installable on any currently installed products"

The install log says: "Found Installed Product - Microsoft Visual Studio Community 2015" and "Found Installed product - Microsoft Visual Studio 2015 Shell (Integrated)"

I then tried skipping to step 7) and copied emacs.vsk into "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common 7\IDE" and typed Edit.EmacsBreakLine in VS's command window (View/Other Windows/Command Window) but got "Command "Edit EmacsBreakLine" is not available".

At the end of step 5 or step 7, the Emacs emulator does not work. My hunch is that the version set in the EmacsEmulation.vsix - extension.vsixmanifest is set incorrectly, but I do not know which version to use:

<SupportedProducts>
    <VisualStudio Version="11.0">
    <Edition>Pro</Edition>
    </VisualStudio>
</SupportedProducts>

I have tried version=12 and edition=Express_All

Thanks!

Community
  • 1
  • 1
user3211306
  • 388
  • 1
  • 4
  • 12

2 Answers2

11

I made it work by change the version to 14. So it will look like this:

<SupportedProducts>
    <VisualStudio Version="14.0">
    <Edition>Pro</Edition>
    </VisualStudio>
</SupportedProducts>

All the rest of the steps are the same from this post: https://stackoverflow.com/a/14087731/3112973

And make sure that Emacs.vsk is listed in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\. This is the file with the key binding assignments. If not, just copy it from the folder that you unzipped in step 2 in the link.

Community
  • 1
  • 1
Tony
  • 1,405
  • 3
  • 20
  • 31
  • It sort of works .. when I fire up VS, and I'm in the edit window, my keyboard is partially dead (I can add characters, but etc doesn't work. Only after I run the program, or create a separate text file, does it bring back the keyboard to life and fire up the Emacs bindings. Anyone have an idea why? It's workable this way - but cumbersome :-( Having these bindings makes the environment so much more usable. I wonder why MS wouldn't provide these a part of the standard install. – Levon Dec 04 '16 at 16:52
2

To install the EmacsEmulations.vsix file for Microsoft Visual Studio Community 2015 (which reports its version as 14.0), there is an installer tool, VSIXInstaller.exe, in the folder:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>

After modifying the vsix file as per post mention above (inserting version "14.0" and edition "Community" in my case), the following worked for me from an admin command line (fill in your own full paths):

VSIXInstaller.exe /a EmacsEmulations.vsix

Note that after selecting Emacs in the keyboard mapping drop down in Tools/Options/Environment, the change didn't seem to take right away. I restarted Visual Studio and it didn't take yet either.

I then searched for installed key bindings with "emacs" in the name and they were there. Seemingly after that they were then active in the editor, so I'm not 100% sure what it was that triggered the activation.

limey
  • 21
  • 1
  • I'm having the same problem. What do you mean by "searched for installed key bindings with emacs in the name"? – dinosaur Jun 14 '16 at 23:45
  • For the activation of the extension be sure to set your keyboard mapping scheme to "Emacs" and then restart VS. – Jaime Hablutzel Oct 27 '16 at 23:37
  • 1
    I think limey means he searched in the "Show commands containing" text box right below the keyboard mapping dropdown in Tools/Options/Environment. I saw the Emacs commands there too, but even after doing this and restarting several times, it didn't work. I gave up, and then suddenly it started to work! There's some mystery here :) – Rahul Jha Feb 10 '17 at 21:44