Skip to main content
Glimpses of Daniel's world

The pleasure of block selection whilst editing code

Sometimes you wish that writing code would be easier... or at least a bit more efficient. Today I used the block selection mode (default shortcut: Alt + Shift + A) in Eclipse once again. There was a need to insert a common piece of text into several lines. The first thing I noticed was that the lines were all aligned perfectly. This made me think that block selection mode would be the best way to save some time and avoid making mistakes.

The first thing I did was selecting the block of lines that needed editing, but keeping the selection's width to zero because there was nothing that needed replacing. Then it was time to type in the text, putting in the same words across several lines at once! Was this efficient? Yes, it was because any mistakes made will be uniform and, while I was still in block mode, the same would go for the corrections. Then I decided to blog about it, so in the end I actually lost some time on it after all.