2010-06-21 50 views

回答

1

VS宏創建一個新的,添加以下代碼:

Sub ToggleEmacsKeyBindings() 

    Dim emacsSchemeName As String = "Emacs" 
    Dim defaultSchemeName As String = "(Default)" 

    Dim props As EnvDTE.Properties = DTE.Properties("Environment", "Keyboard") 
    Dim propsItem As EnvDTE.Property = props.Item("SchemeName") 

    Dim previousScheme As String = propsItem.Value 

    If propsItem.Value = emacsSchemeName Then 
     propsItem.Value = defaultSchemeName 
    ElseIf propsItem.Value = defaultSchemeName Then 
     propsItem.Value = emacsSchemeName 
    End If 

    MsgBox("Previous Scheme: " + previousScheme + Environment.NewLine + Environment.NewLine + "New Scheme: " + propsItem.Value) 

End Sub 

然後,您可以assign a keyboard shortcut to this macro更快,更輕鬆地Emacs'Default'鍵盤方案之間切換。

(注:本作品在VS 2005和VS 2008中沒有測試,但它應該工作過它也可以在VS 2010中安裝了Emacs emulation extension。)

+0

你真了不起。謝謝! – 2010-06-22 07:29:50

1

VisEmacs允許您在Visual Studio中使用Emacs編輯文件。所以你根本不必切換鍵盤綁定!有關VisEmacs的更多有用信息是here

+0

我寫ASP.NET MVC,因此我非常依賴Visual Studio中的Intellisense。我不認爲VisEmacs支持這個,是嗎? – 2010-06-21 15:10:16

+0

@deniz VisEmacs不支持智能感知! – 2010-06-21 16:17:05

相關問題