くの、めんどくさいんだよなVisual Studioの自動作成ブレースのための機能ブロック?

StackOverflow https://stackoverflow.com/questions/9486

  •  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

編集:を使用したマクロレコーダーこそんなに悪い

達成できるコードスニペットを、既に内蔵(み打"svm"と打ブ-タブ)..

が豊富な情報の作成これらの:

ジェフにしたポスト自身がこちら

て!えて使うためにも、もっと盛りだくさん!D

視覚補助 しています。

私が作成したスカルです。ここにしたいのヒットに入って鍵の組み合わせです

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
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top