How do I enable the column selection mode in Eclipse?

EclipseIdeText EditorEclipse 3.5

Eclipse Problem Overview


News wrote that Eclipse 3.5 finally supports column selection. Unfortunately I don't know HOW to enable it. I tried pressing the ALT-key like I am used to in Visual Studio and all other Microsoft products but that had no effect.

How can I mark a vertical block in Eclipse?

Eclipse Solutions


Solution 1 - Eclipse

To activate the cursor and select the columns you want to select use:

> Windows: Alt+Shift+A

> Mac: command + option + A

> Linux-based OS: Alt+Shift+A

To deactivate, press the keys again.

This information was taken from DJ's Java Blog.

Solution 2 - Eclipse

On Windows and Linux, it's AltShiftA, as RichieHindle pointed out. On OSX it's OptionCommandA (A). It's also worth noting that the two modes can have different font preferences, so if you've changed the default text font, it can be jarring to toggle block selection modes and see the font change.

Finally, the "search commands" (Ctrl3 or Command3) pop-up will find it for you if you type block. This is useful if you use the feature just frequently enough to forget the hotkey.

Solution 3 - Eclipse

As RichieHindle pointed out the shortcut for column (block) selection is Alt+Shift+A. The problem I ran into is that the Android SDK on Eclipse uses 3 shortcuts that all start with Alt+Shift+A, so if you type that, you'll be given a choice of continuing with D, S, or R.

To solve this I redefined the column selection as Alt+Shift+A,A (Alt, Shift, A pressed together and then followed by a subsequent A). To do this go to Windows > Preferences then type keys or navigate to General > Keys. Under the Keys enter the filter text of block selection to quickly find the shortcut listing for toggle block selection. Here you can adjust the shortcut for column selection as you wish.

Solution 4 - Eclipse

First of all your mouse key must be focus in editor to enable Toggle Block Selection Mode

enter image description here

Click on toggleButton as shown in figure and it will enable Vertical selection. After selection toggle it again.

Solution 5 - Eclipse

Additionally, you can change the keys view window -> preferences then type: 'keys' and when the key preference page opens you can type 'toggle block selection' and voila!

Solution 6 - Eclipse

You can enable and disable column editing mode via the keyboard shortcut ALT-SHIFT-A.

Once enabled you can then use either the mouse to select a block of text, or the keyboard using SHIFT (like a normal keyboard select, except the selection will now be in a block).

If you've changed your default font for text editing, entering column editing mode will probably change your screen font to the default column editing font (which is probably different to your changed font. To change the font when in column editing mode, go to the menu and select Window -> Preferences, then in the tree on the left hand side, pick General -> Appearance -> Colors and Fonts, and then pick Basic -> Text Editor Block Selection Font on the right hand side tree. You can then select the font to be consistent with your "not in column editing mode" font.

Solution 7 - Eclipse

A different approach:

The vrapper plugin emulates vim inside the Eclipse editor. One of its features is visual block mode which works fine inside Eclipse.

It is by default mapped to Ctrl-V which interferes with the paste command in Eclipse. You can either remap the visual block mode to a different shortcut, or remap the paste command to a different key. I chose the latter: remapped the paste command to Ctrl-Shift-V to match my terminal's behavior.

Solution 8 - Eclipse

  • Press Alt + Shift + A
  • Observe that the screen zooms out
  • Make selection using the mouse
  • Press Alt + Shift + A to go back to the old mode. enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionvobjectView Question on Stackoverflow
Solution 1 - EclipseRichieHindleView Answer on Stackoverflow
Solution 2 - EclipseGeoffrey WisemanView Answer on Stackoverflow
Solution 3 - EclipsePeter AjtaiView Answer on Stackoverflow
Solution 4 - EclipseZar E AhmerView Answer on Stackoverflow
Solution 5 - Eclipsejavamonkey79View Answer on Stackoverflow
Solution 6 - EclipsejklpView Answer on Stackoverflow
Solution 7 - EclipseHRJView Answer on Stackoverflow
Solution 8 - EclipseS KrishnaView Answer on Stackoverflow