views:

126

answers:

2

In visual studio you can select a block of text by holding down <alt> when when selecting text with the mouse. This is very useful for selecting a column of data or text as opposed to the entire line.

In Visual Studio 2003-2005 this operation could be performed by holding <alt><shift> in conjunction with the arrow keys but the keyboard option no longer works in VS2008.

Can anyone tell me the editor command to assign to a keyboard shortcut? Is this keyboard shortcut just moved to something else in VS 2008?

+3  A: 

The <alt><shift><arrow> key combination still works in VS2008 (at least it does in my default key mappings). It is possible that your key mappings are not set correctly to what you expect to work.

To manually set the key mappings, you need to look at Edit.LineUpExtendColumn, Edit.LineDownExtendColumn, Edit.CharLeftExtendColumn and Edit.CharRightExtendColumn in the keyboard settings and reassign them.

adrianbanks
Thanks for the answer. Right after I submitted this I was looking through the keyboard shortcuts and found the commands you mention and I finally understood how it is setup (I'll detail this in a separate answer). Since you say alt+shift+arrow works for you I'm now suspecting that the difference is that I'm using Team Suite or you chose a the profile for VS2005 compatibility the first time you started VS 2008. Are either of these a possibility?
RonnBlack
I always choose the `Visual C++` keyboard mapping in Visual Studio as I'm used to hitting `F7` to compile. I can only assume that the keyboard shortcuts for box selections are set this way by default in that mapping.
adrianbanks
A: 

Right after I submitted this I was looking through the keyboard shortcuts and found the commands Adrian mentioned. By looking at how these are mapped and playing around a bit more I figured out how it is setup in the default profile for Team Suite.

To start a block select you press <alt><shift><home> or <alt><shift><end>. This highlights to the end of the line or the start of the line depending on what you pressed.

Thereafter <shift><arrow> and <ctl><shift><arrow>, can be used to expand the region as desired.

RonnBlack