こんにちはVS 2015はバグがあり、時々私のショートカットのいくつかを復元しなければなりませんでした。 F.e. ctrl +; LineEndと他のもののために。マクロを使って、これをプログラム的にやる方法がありますか?Visual Studioのキーボードショートカットをプログラム的に作成する方法
解決済み。コマンド対に割り当てられたすべてのキーボードショートカットは、(それがVSIX develor避けることができます)はっきりしていないスクリプトが更新されます
using System;
using EnvDTE;
using EnvDTE80;
public class C : VisualCommanderExt.ICommand
{
public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package)
{
string commandName = "Edit.LineEnd";
string shortcut = "Text Editor::ctrl+;";
EnvDTE.Command cmd= DTE.Commands.Item(commandName, 0);
// Retrieve the current bindings for the command.
Object[] bindings = ((System.Object[])(cmd.Bindings));
// Get the number of bindings for the command.
int bindingNumber = bindings.Length;
// Add two more elements to the array to accomodate two
// new commands.
// Create temp variable for copying values.
// Arrays are zero-based in C#.
object[] temp = new object[bindingNumber + 1];
System.Array.Copy(bindings, temp, Math.Min(bindings.Length, temp.Length));
bindings = temp;
// Add the new bindings to the existing ones in the array.
bindings[bindingNumber] = shortcut;
cmd.Bindings = bindings;
}
}
インストールに問題がある場合は、VSがバグであると想定せずに修復する必要があります。問題は残り、おそらく悪化するでしょう。ショートカットについては、単純に*リセットしないのはなぜですか?または、[ツール]> [インポートとエクスポートの設定]からエクスポート/インポートしますか? BTW LineEndはEndキーに過ぎません。 –
[Visual Studioでのキーボードショートカットの特定とカスタマイズ](https://msdn.microsoft.com/en-us/library/5zwses53.aspx)をチェックしてください。キーボードショートカットを含む設定をエクスポートする方法を示します。 –
devenv.exe/ResetSettingsを実行して、IDE全体のデフォルト設定に戻すことができます。他のカスタマイズを失っても構わない場合は、それは可能でしょうか? –