How to indent csharp code in the vs2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • puzzlecracker

    How to indent csharp code in the vs2005

    something similar to ctrl-i in exclipse.
  • Peter Duniho

    #2
    Re: How to indent csharp code in the vs2005

    On Mon, 22 Sep 2008 11:35:08 -0700, puzzlecracker <ironsel2000@gm ail.com>
    wrote:
    something similar to ctrl-i in exclipse.
    There's probably a more direct way, but I'm lazy so...

    One way to do it is to select the code you want auto-formatted, then cut
    it and immediately paste it right back where it was. That is, just type
    Ctrl-X followed by Ctrl-V. The default setting in VS is to auto-format on
    paste.

    Comment

    • Duggi

      #3
      Re: How to indent csharp code in the vs2005

      On Sep 22, 11:35 am, puzzlecracker <ironsel2...@gm ail.comwrote:
      something similar to ctrl-i in exclipse.
      try

      from menu Tools-Options
      From options dialog -TextEditor -C# -formating -indentation

      -Cnu

      Comment

      • Duggi

        #4
        Re: How to indent csharp code in the vs2005

        On Sep 22, 11:47 am, "Peter Duniho" <NpOeStPe...@nn owslpianmk.com>
        wrote:
        On Mon, 22 Sep 2008 11:35:08 -0700, puzzlecracker <ironsel2...@gm ail.com> 
        wrote:
        >
        something similar to ctrl-i in exclipse.
        >
        There's probably a more direct way, but I'm lazy so...
        >
        One way to do it is to select the code you want auto-formatted, then cut  
        it and immediately paste it right back where it was.  That is, just type  
        Ctrl-X followed by Ctrl-V.  The default setting in VS is to auto-formaton  
        paste.
        I dare to suggest another shortcut... remove the last } and type it
        again... the default settings for VS auto formats the code in the
        { and } block.

        -Cnu

        Comment

        • Peter Morris

          #5
          Re: How to indent csharp code in the vs2005

          01: Highlight code
          02: Press TAB to indent or
          03: SHIFT + TAB to unindent (or maybe CTRL)

          I think CTRL+K+D formats.

          Comment

          Working...