2010-06-21 41 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

相关问题