More Emacs for the favorite IDE
We would like to share with you the details on Emacs specific features introduced in IntelliJ IDEA 11 release last year and some new which are upcoming in IntelliJ IDEA 11.1. Meet Kill rings, Sticky selection, Adjust line and more.
Emacs provides a concept of kill ring. IntelliJ IDEA supports it by introducing a bunch of editor actions that accumulate adjacent removed blocks of code. For example, traditional way to move multiline block of text is to select it, invoke Cut action, move caret to the target position and invoke Paste. Emacs users may achieve that by pointing caret to the target block start, performing C-k (Ctrl-K, Cut up to Line End) necessary number of times, moving caret to the right position and executing C-y (Ctrl+Y, Paste).
It may sound more complicated than really is, but it’s a neat feature that is hard to give up when you get used to it.
Emacs allows to switch the editor to a special mode when every caret move changes selection boundary offset. E.g. we can copy a target block by positioning caret at the start position, moving it to the target end position holding Shift and eventually performing Copy. Emacs way is to move caret to the start position, enter Sticky selection mode (C-SPC, Control+Space), move caret to the target position (no need to hold Shift) and calling M-w (Alt+W, Save to Kill Ring).
It’s also possible to swap caret position between sticky selection boundaries using standard Emacs shortcut C-x C-x (Control-X-X).
It’s just Tab. Has a special behavior for Python code editing as it cycles active line via the appropriate indent levels.
More standard actions are configured to the default Emacs shortcuts in IntelliJ IDEA Emacs keymap.
Just a couple of words in conclusion. Original Emacs feature set is enormous and it is hardly possible to add them all to IntelliJ IDEA. However, we are glad to provide those that are commonly used and would be interesting for the big number of our users.
Despite the fact that all these features are inspired by Emacs and have standard bindings in default Emacs keymap, they can be easely configured for any local keymap.
All the features including new are available in the latest IntelliJ IDEA 11.1 EAP build. Don’t hesitate to submit feature requests to the tracker. Any feedback here is also appreciated.