Bernd's Memory Leaks

Know IDEA, part 1: Column insert

posted: 2009-08-18 11:42
filed under: Intellij | IDEA | IDE | Java

Most of the day, I'm using one particular software: a Java IDE. I've tried Eclipse. It's nice and everything. But I've only found that one particular IDE really does (nearly) everything right for me. It gives me a big productivity boost. You know, those small features and gems that make your day. I'm using Jetbrain's Intellij IDEA.

IDEA has a column selection mode. (Menu -> Edit -> Column Mode) This fact in itself is nothing very special. Microsoft Visual Studio had column mode in the late 80ies, if I remember correctly. It was a hidden feature at first and proved very helpful over the years. Now, I'm no longer using the Visual suite and they seem to be far behind the IDE train.

Column mode is especially helpful when you want to replace the same text on multiple consecutive lines. You select one or more column on a couple of lines, just like you would select cells in a spreadsheet.

This selection can be copied and pasted around. Yeah!

What's not so obvious is that you can even paste a single line fragment that's already on your clipboard. And that's how it works: Select and copy some text with regular selection mode. Then switch to column mode, select a box and hit paste. What you now get is that the copied text is pasted to every single line of your box selection. A multi-paste.

This even works when the selected box is multiple lines, but zero columns. This way, you can prepend text on multiple lines at once, with one strike, without artifical replace constructs.

UPDATE: Emmanuel Lécharny has responded with how to do column mode with Eclipse. Thanks!

Disclaimer: I'm in no way affiliated with JetBrains. Really. I'm just enthusiastic and a little bit biased. That said, I'm a happy user of a free license for Intellij IDEA, due to my work on Open Source projects and I'm grateful for that.

© 2002-2009 bernd fondermann brainlounge, contact/legal notice