Random Visual Studio 2008 Tips #2
Select columns of text with Shift + Alt
If you ever find yourself copying and pasting a line of code to change one value in each line, this tip is for you. Let’s say you want to create 10 pieces of test data – to be aptly named test1, test2, and so on. So you write the first one, then copy and paste the line 9 times.
Now, of course, you have 9 lines to update. You can speed up the process by selecting the columns of “1”s. Place your cursor next to the character. Press Shift + Alt and then use your Left or Right Arrow keys to select the column to delete on your current line. Use the Down or Up Arrow keys and suddenly you’re selecting the column! It’s amazing!
This is just a little time saver, but I happen to use it often, and really enjoy it’s simplicity.
Just one little note, make sure you use a left or right arrow before you use the down or up arrow – otherwise VS assumes you want to select the entire line of code.
