
VS10 充滿了快捷方式,其中大部分我覺得沒什麼用,有時甚至很煩人。我想清除所有這些,然後只設定一些我真正想要/使用的快捷方式。搜尋列表並手動刪除每個列表是非常乏味的。
有沒有一種快速方法可以一次消除所有快捷方式?
也許一些廉價的腳本?它不必很優雅。
(我意識到我可能會丟失諸如“編輯器中向左箭頭”之類的東西,但我可以輕鬆修復這些東西)。
答案1
您應該能夠建立一個巨集(或 2012+ 中的 PowerShell 腳本)來進行所需的變更。我現在沒有 VS 2010 的工作版本可供測試,但類似這樣的東西應該可以工作:
Sub ClearBindings()
Dim cmd As Command
Dim props As EnvDTE.Properties = DTE.Properties("Environment", "Keyboard")
Dim prop As EnvDTE.Property
' Because you cannot programmatically change the default keyboard
' mapping scheme settings, you must first make a copy of the
' Default Settings for the Keyboard Mapping Scheme.
prop = props.Item("SchemeName")
' Sets the Scheme property value to a new keyboard scheme.
' This saves the old keyboard mapping scheme and allows you
' to add new key mappings.
prop.Value = "%LOCALAPPDATA%\Microsoft\VisualStudio\10.0\NoKeyBindings.vsk"
For Each cmd In DTE.Commands
cmd.Bindings = ""
Next
End Sub