I’m reading
The Pragmatic Programmer
at the moment. Chapter 3 has a section about using power-editors; it has an
example showing how easy it is to sort lines of the import section of
a Java file in Emacs or vi.
Reading that felt strange. I remember doing the same thing in Emacs before, but I use IntelliJ IDEA for Java files now. But that wasn’t the strange thing.
I realized that I haven’t manually typed an import
statement for over a year.
I don’t think I’ve even seen an import statement for a while. I keep the
import statements “folded”. IDEA tells me if there is a redundant import
statement by “greying” the folded import section, and
Alt-Ctl-O fixes that. And it keeps them sorted in the right order, too.
