Search code examples
eclipseline

How to do multiple line editing?


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.


Solution

  • 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.