Take the 2-minute tour ×

I want to edit multiple lines in eclipse, but I can't find any short cut or Plugin. In Geany I just press ctrl+alt+up/down I can add / edit multiple lines.

Maybe this example can explain what I mean:

var text = "myname";
var addr = "myaddr";
var age = "myage";

I want to edit text above into:

var my_text = "myname";
var my_addr = "myaddr";
var my_age = "myage";

The text above is just a simple example, but sometimes I have many lines of words that I have to edit its prefix.

share|improve this question
add comment

2 Answers

up vote 39 down vote accepted

Press alt + shift + A to Toggle block selection (Toggle block / column selection in the current text editor), this will let you write vertically in eclipse, then you can easily do this.

Go to Window->Preferences.

enter image description here

Find for binding in text box surrounded by red box.

share|improve this answer
i press alt+shit+A, and it show pop up android menu –  yuda Feb 27 '12 at 7:16
@yuda: Go to Window->Preferences. Then in General->Keys. Find for Toggle Block selection and change it's binding to some other key. Or Find for Alt + Shift + A and change/remove other bindings except toggle block selection. –  Harry Joy Feb 27 '12 at 7:20
how to filter or find other key's that binding to alt+shift+A..? –  yuda Feb 27 '12 at 7:53
It's worth noting this works only when the edits you want to make are column-aligned. –  Geoffrey Wiseman Jan 4 '13 at 21:19
@Harry Joy - In some editors, you can have multiple cursor points that aren't necessarily column aligned, on different lines, editing. Eclipse doesn't, near as I can tell, offer that option. –  Geoffrey Wiseman Jan 8 '13 at 5:25
show 5 more comments

On OS X, the key combination for multi-line edits in Eclipse (or STS) is option/alt+command+A

share|improve this answer
add comment

Your Answer


