くの、めんどくさいんだよなVisual Studioの自動作成ブレースのための機能ブロック?
-
08-06-2019 - |
質問
う誓いに人にタイピング機能なヘッダやその打鍵を組み合わせを自動作成機能ブレースを挿入し、カーソル間のように:
void foo()_
へ
void foo()
{
_
}
これを内蔵する方法はありますか?
解決
チェック 簡単に、ios、androidとmac用にc# -では、Visual Studioの追加とともにこの機能は、他の多くの開発に役立っています。
も C#Completer, 他に追加できます。
したい場合はロールの自分で、チェックアウト この記事.狂気がついていなかった。
他のヒント
ツールにも(特に簡単に、ios、androidとmac用にc#で$を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