This project tries to mimic Spacemacs key bindings in Eclipse IDE.
SPC b b in Spacemacs let you switch between buffers, so it makes
sense to map it to the “Quick switch editor” Eclipse command.
How it works
This project can be seen as a set of configuration files for the Vrapper plugin,
which enables vim emulation inside Eclipse.
~/.vrapperrc is the file where Vrapper lets you add Vim initialization
commands, i.e. this file is like
~/.vimrc for vim.
IdeaVim parses the most common vim commands, together with the custom
:eclipseaction[!] <name> <id> and
:eclipseuiaction[!] <name> <id> commands,
used to bind the Eclipse action with the specified <id> to a (command line mode)
Spaceclipse provides different files, which can be included individually in
.vrapperrc, in order to get only the functionalities you want.
Spaceclipse is composed of three modules:
- Contains Spacemacs settings and key bindings that can be replicated with a similar behaviour in Eclipse.
- Contains settings and key bindings not present in Spacemacs, but that may be useful in Eclipse.
- Contains key bindings that start with
SPC m, that may or may not be present in some Spacemacs major mode.
Furthermore, Spaceclipse provides some of the features of Spacemacs hybrid
mode, which may be enabled by sourcing the file
Read ./KEYBINDINGS.org to see all 200+ available key bindings.
- Install Vrapper from the Marketplace or by going to
Help -> Install New Softwareand inserting the update site http://vrapper.sourceforge.net/update-site/stable
- Go to
Preferences -> General -> Keys. Search for all the key bindings that you normally use in vim (like
<C-b>for example) and click on “Unbind command” if you wish to use them in vim.
- Clone this repository in your home directory:
cd ~ git clone https://github.com/MarcoIeni/spaceclipse
- In your home directory, create the file
.vrapperand edit it in order to include the modules you want by sourcing the relative source files. In the following there is an example of
.vrapperfile that includes all the functionalities offered by Spaceclipse. In this file you can also include your own vim commands.
" Selected Spaceclipse modules source ~/spaceclipse/spacemacs.vim source ~/spaceclipse/extra.vim source ~/spaceclipse/major.vim source ~/spaceclipse/hybrid.vim " My own vim commands nnoremap Y y$
- (optional) source your vimrc file by adding the line
.ideavimrc(you may break something).
In order to update run
git pull inside the spaceclipse directory.
List IDE actions
- Install Eclipse PDE (Plug-in Development Environment)
- Click on
File -> New -> Other...and select “Cheat Sheet”. Select a project, assign a filename, leave “Simple Cheat Sheet” selected and click “Finish”.
- Open the file, expand “Title”, click on “Item” and press the “Browse…” button.
If you find a useful IDE action that is not present yet, feel free to open a pull request to add it.
In order to avoid conflicts for the sake of a good organization, key bindings
actions are named with the following convention:
Support new languages
Currently Spaceclipse only supports C/C++ and Java for language specific commands, but adding a new language is super easy!
grep "^au " -r ~/spaceclipse/ to see commands that needs to be
adapted to other languages.
Go back to code
Key bindings only work when you are inside the code.
For example, if you are inside the project explorer they don’t work.
Preferences -> General -> Keys and search for
the command “Activate Editor”.
This binding will bring the focus to the last visited code window and you will
be able to use Spaceclipse key bindings again.
By default this command is mapped to <F12>, you can change it from this menu.