04 March 2005

Import/Export VS.Net keybinding shortcut mappings

Every time a new Visual Studio released there are changes to the key binding or shortcut key mappings. Vs.NET 2005 seemed make sense than its predecessors as it introduces command themes and use chords (e.g. Ctrl+k, ctrl+c) instead of three-key shortcuts (Ctrl+Shift+b), as discussed in JoeN's Blog So why did the C# keybindings change?

But it just annoying when everytime move to a new developement box, I have to reassign the keybings from Tools(Menu) Customize Keyboard...(button). At the moment I am fine on stealing my beloved box when I moved to new team without being caught by security cameras (there are two in the office known to me :-) ). Would it be great if I can just export the profile and import it to the new IDE? Seen a really straight forward idea, but VS.NET doesn’t offer you such function.

As I am car-sharing with Jim and he is still fiddling on live release (Friday, 18:30 pm) I am in the mood for a little experiment.

After a few searches, I found Joel Ross wrote a blog Saving VS.NET Settings on how to do it. The article also covers saving setting for Window Layouts, Toolbar\Menu Configurations, Customized Toolbox Settings and other Add-ins settings. For now saving a copy of keybindings and ReSharper will serve me well.

Task 1 Export/import custom Keybindings:

  • Create Custom Keybindings: Launch an instnace of VS.NET. Then click Tools(Menu) | Customize | Keyboard...(button on the pop-out property window). This will open the Options window.

  • Assign shortcuts to commands as you wish. I select the Reflector add-in command: Reflector.ManageAddIn.Connect.Diassembler.CSharpCommand and assignit ALT+T,I

  • Save the Keyboard mapping secheme as a new seheme using the "Save as" button. I save it as Jingye keybindings

  • Click OK to close the Option window. Then close the Customize window. Close the VS.NET instance so the setting saved to your personal VS AppData directory

  • Use windows file expolorer to go to your AppDara directory: “\Documents and Settings\%Current User%\Application Data\Microsoft\VisualStudio\7.1\”

  • In this directory you will find a file called: "Jingye keybindings.vsk", it contains the shortcuts just created.

  • Copy and take it to another development machine, still put it in the same directory. If this directory is not existed, create it as “\Documents and Settings\%Current User%\Application Data\Microsoft\VisualStudio\7.1\”

  • Launch an instance of VS.Net on this machine, and select "Jingye keybindings" from Tools(Menu) | Customize | Keyboard...(button)| Keyboard mapping secheme (drop down list)

  • Now the new shortcut [ALT+T] [ALT+I] can be used on the new environment.

    While doing this I notice there are a folder "JetBrains" in the “\Documents and Settings\%Current User%\Application Data\". Guess can move the ReSharper profile I assigned in a similar way.

    Task 2 Export/import ReSharper user profile/options.
  • ReSharper adds a "ReSharper" menu to the VS.NET IDE. You can change the default setting with "Options..." sub-menu. Such like code style, code completion, etc.

  • The user settings is saved to “\Documents and Settings\%Current User%\Application Data\JetBrains\ReSharper\UserSettings.xml" once you close the VS.net instance.

  • The UserSettings.xml contains all configurable settings including code style, intellisense, as well as license key. You can port this file to a different user profile or developement box, but be careful and stay at the right side with the license agreement. Guys work on this deserve every respect of it.

  • I am still waiting for Jim to complete the release... :-(


    Anonymous said...



    Anonymous said...

    Useful piece of tip, cheers for the effort of putting it out.

    Old buddy from lkcn, zb9ab