4

This might be a personal preference, but I'm bit used to do this kind of aligning using tabs

        Application excelApplication    = null;
        Workbooks workBooks             = null;
        Workbook activeWorkBook         = null;
        Worksheet activeWorkSheet       = null;

Is there anyway I can get it done automatically using some key combinations? At the moment I do align/indent using tabs manually. I know Ctrl K + Ctrl F exists, but it does't give the above alignment/indentation.

Any plugins/ formatting tips are highly appreciated. I also use Resharper, is there a setting in Resharper which can do this?

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
Mike
  • 3,204
  • 8
  • 47
  • 74
  • 1
    possible duplicate of [ReSharper formatting: align equal operands](http://stackoverflow.com/questions/1286806/resharper-formatting-align-equal-operands) – Andrew Hare Feb 08 '12 at 00:30

2 Answers2

4

Go here and download the 'Productivity'Tools for VS2010: http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef

Scroll down to the paragraph Align Assignments, it does what you want.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
0

CodeAlignment - MUCH better than Productivity Tools. CodeAlignment can align on just about any character while Productivity Tools can only do "="

And I discovered that CA is smart about code blocks. Without highlighting anything CA will align an entire code block - put the cursor on any line and it affects all lines above and below that line until it gets to a blank line. Alternatively you can select the desired lines first.

radarbob
  • 4,964
  • 2
  • 23
  • 36