Aligning code using tabs in VS 2010

This may be a personal preference, but I'm a little used to this alignment using tabs

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

Is there a way I can do this automatically using some keyboard shortcuts? I am currently aligning / indenting using manual tabs. I know that Ctrl K + Ctrl F exists, but it does not give above alignment / indentation.

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

+4
source share
2 answers

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

Scroll down to โ€œAlign Destinationsโ€, it does what you want.

+4
source

CodeAlignment - MUCH better than productivity tools. CodeAlignment can be aligned with almost any character, while Productivity Tools can only do "="

And I found that CA is smarter about code blocks. Without selecting anything, CA will align the entire block of code - place the cursor on any line and it will affect all lines above and below this line until it hits an empty line. Alternatively, you can first select the desired lines.

0
source

Source: https://habr.com/ru/post/1395330/


All Articles