Binding Emacs Keys in Visual Studio 2017

I am trying to get Emacs style keybindings in VS 2017.
From Q & As related to the previous - VS -, I tried:

  • VS settings (Tools-> Options-> Environment-> Keyboard) but no Emacs option: apparently it was removed starting in VS 2010;
  • XKeymacs (although it seems antique, who knows?) But it only supports pre-Vista Windows versions and I am running windows 8;
  • VisEmacs , but supports VS up to version 2008;
  • Downloaded the VS 2010 extension , extracted from the archive, modified version (see note below for how I extracted it), re-archived and run it with VSIXInstaller as described in this answer .

    However, after I selected the Emacs option in VS keyboard mappings, and after several restarts, not only failed to bind Emacs key bindings to them, but the previous kbd mappings were disabled, even the usual ones like Ctrl + arrows. I checked the commands too there, they just don't work.

So this is where I am stuck.


NB To find the VS version:

C:\Program Files (x86)\Microsoft Visual Studio\Installer>vswhere.exe
Visual Studio Locator version 1.0.62 [query version 1.10.80.60812] Copyright (C) Microsoft Corporation. All rights reserved. installationName: VisualStudio/15.2.0+26430.16 installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community installationVersion: 15.0.26430.16


Tried 15.2

and 15

. (and 17

and 16

and 15.3

, before that :))


PS This question seems to have been asked for every VS version ... This might be a hint for the VS command :).

+3


source to share


2 answers


I've had to do this setup myself a few times and thought I'd try my hand at the 2017 variety, so here it is!

I followed the general instructions listed in other solutions here and here .

The .vsixmanifest extension contains the following entries (related section only):

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

      

Version 15 will work with VS Community 2017. The edition should be Pro as there is no difference as in the previous Express editions.

Note that when you create a zip file you need to do it like this so that vsixmanifest, dll, pkgdef, etc. all were contained in the zip root. This means that you should not zip the EmacsEmulation folder, but simply zip the contents from the folder.



Then I opened an admin command prompt to install the file. Visual Studio 2017 was closed when I did this. I have my setup in default folders.

"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\ide\VSIXInstaller.exe" /a EmacsEmulation.vsix

      

Note. I saw a bunch of warnings about this extension running VS 2017. Against all the warnings, I kept installing the extension.

Warning . Extension warnings that are potentially incompatible with VS 2017 are just around the corner. I was glad to see that the keymap was available when I opened Tools -> Options ... Environment / Keyboard, but when I went into my code, I couldn't get it to go to the beginning or end of the line. I had to remove the keyboard shortcut for the Select All editor and restart VS before it worked correctly. There may be other caveats for using this extension, so YMMV.

Side note: I took my version that was working since 2015 and just added version 15 to the XML. It seems to be "excellent".

+3


source


Tools -> Extensions and Updates -> (Web Search) Emacs Emulation



+2


source







All Articles