Search code examples
javaandroid-studiointellij-ideaidetext-editor

IntelliJ IDEA way of editing multiple lines


I've seen this done in TextMate and I was wondering if there's a way to do it in IDEA.

Say I have the following code:

 leaseLabel = "Lease";
 leaseLabelPlural = "Leases";
 portfolioLabel = "Portfolio";
 portfolioLabelPlural = "Portfolios";
 buildingLabel = "Building";

What is the best way to append '+ "foo"' to every line? Column mode won't work since the lines are not correctly aligned on the right side... unless there is an easy way to right justify the text :P


Solution

  • Since Idea IntelliJ IDEA 13.1 there is a possibility to edit multiple lines.

    Windows

    Alt + Shift + Mouse click

    macOS

    Option + Shift + Mouse click

    for selection. More about this new improvement in the IntelliJ blog post here. Very useful feature.