题
我可以发誓我看到有人打字功能的标题,然后击中的一些关键的组合自动创造的功能括号,并插入标之间他们就像这样:
void foo()_
要
void foo()
{
_
}
这是一个建立在功能?
其他提示
该工具的好看(尤其是Resharper但美元为200-350哎哟!) 但最后我只记录宏并将其分配给ctrl+alt+[
宏出来像这样:
Sub FunctionBraces()
DTE.ActiveDocument.Selection.NewLine
DTE.ActiveDocument.Selection.Text = "{}"
DTE.ActiveDocument.Selection.CharLeft
DTE.ActiveDocument.Selection.NewLine(2)
DTE.ActiveDocument.Selection.LineUp
DTE.ActiveDocument.Selection.Indent
End Sub
编辑:我使用的宏录音机来做这个并不是太糟糕了
看看 视觉协助 为好。
我刚创建一个基于@卢克的上述。这一个,你想打进入然后打你的关键组合和将插入:
if ()
{
}
else
{
}
它将会把你的光标放在括号通过的,如果声明。
Sub IfStatement()
DTE.ActiveDocument.Selection.Text = "if ()"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "{"
DTE.ActiveDocument.Selection.NewLine(2)
DTE.ActiveDocument.Selection.Text = "}"
DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = "else"
DTE.ActiveDocument.Selection.NewLine(2)
DTE.ActiveDocument.Selection.Text = "{"
DTE.ActiveDocument.Selection.NewLine(2)
DTE.ActiveDocument.Selection.Text = "}"
DTE.ActiveDocument.Selection.LineUp(False, 7)
DTE.ActiveDocument.Selection.EndOfLine()
DTE.ActiveDocument.Selection.CharLeft(3)
End Sub
不隶属于 StackOverflow