IDE Scripting Console - Nashorn Javascript (default) - how to bind an action ?


Sadly there is not a single line of documentation  online (or any working example) for that feature.

I would like to bind a keyboard shortcut to a javascript function that interacts with the editor that  I have developed in the scripting console.
How can I do that ?


Register a custom action and bind it to desired shortcut, then call your script from it. You can find some snippets here


Hello Yann, 
I have been through that list already, there are sadly no Javascript/Nashorn examples on the page and adapting the answers there to Javascript did not work out. None of them are compatible with Nashorn it seems.
There is one javascript example in the description of the "Flora" plugin, but it did not work with Nashorn and the Flora Plugin does not work with phpstorm anymore.

Would you have a 3-liner for me? Just "bind any key" -> "react to it with print("hello") ?


Please sign in to leave a comment.