Why I (finally) moved from Eclipse to Intellij



I had to keep both Eclipse and Intellij running side-by-side for a while, because I could not peel away from Eclipse, my editor of choice for years. A few days later and Intellij has eclipsed Eclipse (pardon the pun). Here' s a few reasons why:


- I't s easy to switch between implementation and test (CTRL+shift+T) in Intellij, there's no equivalent in Eclipse.

- When searching for the usages of a variable/method/class Intellij scopes the search by test files, production files (or both).  In Eclipse you would have to manually specify the full path to search in each case.

- In general Intellij is pretty smart when it comes to refactoring. for instance when renaming a class attribute  the name of the getter method for that class attribute will  be renamed accordingly. 

- Smart code completion: Intellij will make much better suggestions as to what expression type is expected based on the context than Eclipse.

- automatically resolution of import static.
  
- Paste from history

- Use regex in search

- On the downside Intellij is a tad slower than Eclipse and tends to lock up for 30 secs or so once or twice a day.

So overall there's no major functionality or killer feature offered by Intellij that Eclipse cannot replicate. But the difference is in the many little details which are often better thought out in Intellij, resulting in a better experience (and increased productivity).


Regexp use for text transformation with Intellij

Given a snippet of code such as:
put("item123", x);
put("item456", x);
....
put("item888", x);


                
To retrieve the content in between quotes:
item123
item456
...
item888


Then this can be achieved using the in-place find and replace functionality offered by Intellij.
(obviously a manual edit would also work, but might not be as efficient if the block of code is repeated 1000 times).


1. search for the regex put\("


2. replace the selection with an empty field, this yields:

item123", x);
item456", x);
....
item888", x);


3. search for the regex \".+  (select everything extending from the first quote to the end of the line)


4.replace the selection with an empty string yields: 

item123
item456
....
item888