Atomic Object has a great tradition of making and customizing tools. It’s a habit I’ve gained and lost several times over my career — keeping tools sharp requires time and effort. Fortunately, one of the best things about becoming an Atom is that all of my colleagues care deeply about software, so it’s easy to find inspiration to start making tools again.
If you are using Maven, you need to activate the IDE profile in IntelliJ. This is used for applying IDE-specific tweaks which currently only includes applying the MapStruct annotation processor. Open the “Maven Projects” tool window (View - Tool Windows), check the IDE maven profile to activate it. Get to the point. Right, enough rationalisation, let’s get on with it. What I want to do is do my coding in IntelliJ on a day-to-day basis, but immediately load a file into Emacs for any tricky text processing I want to do.
Recently, I’ve been working on a modern Java web app, and I ended up going all-in on IntelliJ 13. It’s a great development environment for mixed language web development (and Android!). The biggest down-side for me is its poor Emacs compatibility out of the box. The pain of hitting keys that don’t work or do something unexpected sent me looking for a cure. As a life-long Emacs user, I just wasn’t willing to down-grade to the Vim plugin, so what started out as key binding tweaks became full-blown plugin development to customize IntelliJ.
My fingers are happy with what IntelliJ can do now, and there’s a clear elisp-style path to add features that I miss.
Simple Keymap Tweaks
I started by changing the key bindings to the built-in
Emacs mode via the menu setting IntelliJ IDEA > Preferences > Keymap. My enthusiasm was short lived. These bindings are archaic and don’t support normal Mac OS commands such as copy and undo ; Emacs 24 and Aquamacs both support standard OS key commands, and I use them frequently. The built-in Mac OS X 10.5+ bindings feel better, but aren’t complete. I raided the Emacs keymap frequently as I stumbled over missing keys.
![]()
There are a few issues that must be solved according to personal taste:
On my mac, installing an intellij using the toolbox will add the app in the Applications Library folder, as well as a shortcut in the Applications folder. If I run the app and pin it, it uses the directory in the Applications Library folder. This works fine, but the directory is associated with a ch-0 subfolder that changes with each update. Tabs: tabs UI wastes space on left border of a tab: Usability: IDEA-208922: Run Anything: no highlighting of matched text: Usability: IDEA-168223: Open recent menu doesn't display project group if any: Usability: IDEA-212381: If a line has a navigation icon with a keyboard shortcut, the shortcut should work anywhere in the line: Usability: IDEA.
Here are some key bindings I added to the built-in
Mac OS X 10.5+ keymap:
IntelliJ Plugins
Changing key bindings only got me so far — it still wasn’t enough. Fortunately, JetBrains has a very impressive extension API for customizing IntelliJ, and the source to the Community Edition is available under an Open Source license. Less fortunately, the documentation is sparse, and examples are not easy to find. Reading the source is the best way to understand the extension API. I highly recommend checking the code out and opening it as a project.
IntelliJ also has a third party plugin repository that is available via the menu IntelliJ IDEA > Preferences > Plugins > Browse repositories. I couldn’t find an Emacs plugin like Emacs+ for Eclipse. In general the plugin repository doesn’t seem as well-stocked as the Eclipse marketplace nor the Emacs package repos such as MELPA and Marmalade.
However, there is a great plugin called LivePlugin that allows scripting IntelliJ with Groovy and Clojure. It gives the user a similar development process to using elisp: write an extension at any time without needing to compile, package or install it.
LivePlugin Scripting with Groovy
Traditional IntelliJ plugin development is fairly heavy weight. You need to create a plugin project using an IntelliJ template and build it similar to a Java app. LivePlugin makes this much easier by allowing you to script a plugin with Groovy directly in any project you are working on. If you need a small utility, you can just pop open an editor and write the code. https://atlanticrenew916.weebly.com/blog/cracked-mac-app-site. The debugging capabilities are limited, but you have full access to the entire IntelliJ extension API.
Here’s a simple command to introduce LivePlugin. It deletes the character under the cursor (“at point,” in Emacs terminology). This is the full code. Build or packaging files are not used. Just open the LivePlugin tool window, hit “+” to create a new plugin, and paste in the code. When you run this plugin, it binds
delete-char to the keystroke C-d so it works just like Emacs.
Here’s a clone of Emacs’
delete-horizontal-space function, again showing all the code:
That can be made much simpler by using a Groovy regex to find the matching space at point, but I wanted to see how similar I could get to the Emacs elisp version:
Tusk- Refined Evernote desktop app.. Here’s a command I made on-the-fly while doing some work with Javascript and RequireJS. My problem was the imports in the project were inconsistent and I was manually reformatting them. Now I can cleanup the imports by just hitting
Option-= .
Intellij Open Apps In Tabs On Macbook
LivePlugin is available in the IntelliJ plugin repository and is very easy to install. There’s no additional setup needed to start writing plugins, but I found it very helpful to checkout the IntelliJ community edition so I could browse the source to the API. The source to LivePlugin is also available at github.com/dkandalov/live-plugin.
I’ve written several small plugins using LivePlugin to make IntelliJ more friendly to Emacs users. Some of these have reasonable built-in IntelliJ implementations, but it was useful to reimplement them to see how well the extension API works. The code is up on github at github.com/kenfox/intellij-emacs.
Running Emacs from IntelliJ
Even with the impressive customization IntelliJ allows, I still miss features and packages in Emacs. The best solution I’ve found is to use IntelliJ IDEA > Preferences > External Tools to add a command that runs
emacsclient . I already hinted at this by showing C-c e as my key binding to run Emacs.
The trick to making this work well is to set the external tool’s parameters to
+$LineNumber$ '$FilePath$' . When I hit Control-C E, an Emacs window appears with the same file and cursor position as it was in IntelliJ. After I’m done editing, I save the file in Emacs, Command-TAB back to IntelliJ, and my changes load automatically.
Setting this up requires more configuration than writing LivePlugin code! If you haven’t used
emacsclient before, try following my setup:
1. Add some code to your
~/.emacs startup file so Emacs will listen for commands:
![]()
2. Wrap
emacsclient in a small shell script named e to make it easier to use:
3. Use IntelliJ IDEA > Preferences > External Tools to add a new command:
Now Go Write Some Code
You now have a nice, comfortable IntelliJ environment with a quick escape hatch to real Emacs. I hope your fingers are as happy as mine.
Enjoy! Edit page
This topic considers the concept of projects based on the IntelliJ Platform and related subjects, such as modules, facets, libraries, and SDK.The project structure and Java classes available to manage projects and modules are discussed.
Internal changes related to a significant redesign of the representation of project models are included in 2020.3 release; please see blog post for details. This shouldn’t affect any plugins using the IntelliJ API properly and which don’t access internal classes.
Project and Its Components
This section briefly discusses the IDEA project structure, project components, and related terms.For more information about projects and their components, refer to Project, Module, Library, Facet in the IntelliJ IDEA Web Help.
Project
In the IntelliJ Platform, a project encapsulates all of a project’s source code, libraries, and build instructions into a single organizational unit.Everything done using the IntelliJ Platform SDK is done within the context of a project.A project defines collections referred to as modules and libraries.Depending on the project’s logical and functional requirements, you can create a single-module or a multi-module project.
Module
A module is a discrete unit of functionality that can be run, tested, and debugged independently.Modules include such things as source code, build scripts, unit tests, deployment descriptors, etc.In a project, each module can use a specific SDK or inherit the SDK defined at the project level (see the SDK section below in this document).A module can depend on other modules of the project.
Library
A library is an archive of compiled code (such as JAR files) on which modules depend.The IntelliJ Platform supports three types of libraries:
For more information about libraries, refer to Library.
SDK
Every project uses a Software Development Kit (SDK).For Java projects, SDK is referred to as JDK (Java Development Kit).
Intellij Open Apps In Tabs On Mac Shortcut
The SDK determines which API library is used to build the project.If a project is multi-module, the project SDK is common for all modules within the project by default.Optionally, a project can configure an individual SDK for each module.
For more information about SDKs, see Working with SDKs in the IntelliJ IDEA Web Help.
Facet
A facet represents a certain configuration, specific for a particular framework/technology associated with a module.A module can have multiple facets.E.g., Spring-specific configuration is stored in a Spring facet.
Intellij Open Apps In Tabs On Mac Os
Facets are documented under Facet and Language and Framework Specific Guidelines in the IntelliJ IDEA Web Help.
Additional InformationIntellij Open Apps In Tabs On Macbook Pro
For more information on each of these entities, see:
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |