Benoit J - My mostly tech blog

IntelliJ to Emacs - part 1 - The Plan

2021-12-10


A bit of my history with editors and IDEs

I’ve been using Emacs and vim since the mid 90s. First for C/C++, then Java. Java has been my primary language since then.

At that time, I really used Emacs as an unmodified editor, not as a custom tool. Using Makefiles, and search/replace to do most of my work.

Eclipse

Around 2005, I made the switch to Eclipse IDE for my Java coding. Main advantages at the time was navigation, runners, debugger, refactoring and code actions. Eclipse was (and still is) a good IDE for Java coding, but a bad editor.

Some issues:

  • lots of modal behavior when doing many operations

  • freezes constantly on such modal operations. You think Emacs freezes, you havent seen Eclipse

  • Made for the mouse. It has many shortcuts to trigger actions, but any actions that needs user input will require the mouse.

  • Somewhat hard to extend. Requires to create a whole project, including a build script, generate an jar. All this to do simple things.

  • configuration hard to maintain

  • mostly prepackaged solution, that support plugins

IntelliJ

In the past 5-6 years, I’ve been using IntelliJ. Main advantages over Eclipse:

  • locks less. operations are not modal

  • a bit more reactive when editing code than Eclipse

  • better snippets

  • configuration can be synched on the cloud

Some issues I’ve seen:

  • 2020-2021 was really bad. they made couple of releases that just made things really slow, hanging, or out of sync.

  • not easier to extend

  • mostly prepackaged solution, that support plugins

  • paid solution, while it’s not really a big deal, it makes it more difficult when changing clients, or for new coders on the team. Here it’s more about delays.

eclim, and other similar modes

I tried couple of modes that tried to bring Java to Emacs. Most of the time, basic features were missing, are not supporting new Java versions, or are unstable.

The Ultimate goal: Code Java in Emacs

With lsp-mode, my dream come true: doing all my coding in Emacs.

As mentionned earlier, Eclipse is a good IDE, but not a good editor. With the development made by lsp-mode, I can now hope to bring the IDE features of Eclipse within Emacs.

The Plan

Over the course of next year, I will:

  1. document all the features I use daily in IntelliJ

  2. categorize them

  3. find how to do something similar in Emacs, lsp-mode, or other modes

  4. post regularly my progress

Editing features I’m looking for

Here are the categories I have in mind at this point:

  1. Basic editing features

    1. import management

    2. code formatting

    3. Search/Replace

    4. Refactoring

    5. Linting

    6. code actions

    7. Navigation

    8. Documentation

  2. Builds

    1. Managing dependencies

    2. Open dependencies documentation and sources

  3. Runners && Debugger

  4. Integration with frameworks

    1. Spring beans

    2. spring integration

    3. spring data

    4. spring initializer

    5. Hibernate / JPA

  5. Other supporting tools

    1. REST Client

    2. Database client

    3. JSON/XML editing