MarcoIeni / intellimacs

Spacemacs' like key bindings for IntelliJ platform.
MIT License
536 stars 94 forks source link

Dinamically show key bindings: which-key implementation #8

Closed MarcoIeni closed 3 years ago

MarcoIeni commented 4 years ago

Introduction

I don't have experience with IntelliJ plugin development, so I would like to discuss with you if it is possible to implement something like which-key:

2019-12-29_1759x167

That is, when you press a key, all the possible key bindings are showed.

In order to implement this, a which-key IntelliJ plugin should be developed.

Which-key plugin requirements

This plugin should be able to do the following things:

Know <key bindings, action> pairs

The plugin shall be able to read all the key bindings and the associated actions defined by intellimacs.

I think that it can do it in two ways:

Read the keys pressed by the user

The plugin shall be able to read the keyboard input in order to dinamically show available key bindings.

If which-key plugin doesn't interfere with IdeaVim, it only has to show the action names.

dogma0 commented 4 years ago

This is amazing, keep at it please.

MarcoIeni commented 4 years ago

Yes, it would be a very useful feature :) I am waiting that someone with some knowledge of the intellij plugin ecosystem replies.

MarcoIeni commented 4 years ago

I found out that IdeaVim supports plugins extensions.

See:

Maybe this could be the right way to do this.

smogstate commented 4 years ago

cool

MarcoIeni commented 4 years ago

Just to be extremely clear: I am sorry, but I don't plan to work on this because currently I am not using intellij IDEs or programming in kotlin/java. :cry:

Anyway, if someone wants to develop this we can talk about it here.

If you want to see a proof of concept, VSpaceCode uses vscode-which-key to implement this feature.

eltone commented 3 years ago

It looks like some enterprising soul has made a start on an idea-vim plugin for this: https://github.com/TheBlob42/idea-which-key

MarcoIeni commented 3 years ago

OMG, this is so awesome..On my way to integrate it!

MarcoIeni commented 3 years ago

Alright. Can some of you test the content of #15 ? You have to:

cd .intellimacs
git pull
git checkout which-key

and then follow the new instructions in the readme.

I added support for the top commands and the ones under spc-w. If it works for you I will open an issue where I explain how to contribute in order to do the same for all the other keys :)

Also, let me know if the docs are sufficient.

When you are done, if you want to go back to the original version do:

git checkout main
materemias commented 3 years ago

I have tried that and it works great! are the differences only to install which-key plugin and enable via source ~/.intellimacs/which-key.vim ?

MarcoIeni commented 3 years ago

Yes! It works well also for me. Thanks for trying it out. I will continue to work on it, then.

MarcoIeni commented 3 years ago

Closing this in favor of #17 where I added instructions on how to solve this issue :) If you think something is not clear or you want some help to start contributing, please let me know.