Binding Command+k to open Insert Link prompt


Command+k is a popular keybinding to insert a link, so I made a basic implementation of this with ProseMirror.

Here’s the code and a demo.


You should return true from the function bound to the key—on many browsers, ctrl-k focuses the URL bar, and if the command doesn’t indicate that it handled the key, the default behavior will go through.


Thanks for reviewing! I updated the code to fix that bug.