Open gabrielmagno opened 1 year ago
I made a fork, and was able to make it installable with pip and updated the code to use CodeMirror v6: https://github.com/gabrielmagno/jupyterext-text-shortcuts/
The code is ugly, since I'm not familiar with CodeMirror and TypeScript, but it seems to be working.
I'm not sure if it is replicating exactly the same behavior of the current extension. For instance, adding the text in a multi-selection is not working on my fork.
Considering that I'm uncertain about my code being good enough, I decided not to create a pull request (but if a maintainer think it is worthy for me to do it, let me know!).
Meanwhile, if anyone wants to install the extension in JupyterLab v4 using my fork, it is possible to install it with this command:
pip install git+https://github.com/gabrielmagno/jupyterext-text-shortcuts/
One does not need to install an extension, JupyterLab has commands for inserting text built-in see https://github.com/jupyterlab/jupyterlab/issues/10114#issuecomment-821993321
Thank you very much @krassowski . Setting up a native shortcut is much more lightweight and preferred (in my opinion) than installing a dedicated extension for a relatively small feature.
But I've tested the native shortcut solution and there are at least two missing behaviors in relation to the extension:
|
is my cursor), if I have my_var|
and press the shortcut, the extension will add a space, resulting in my_var %>%
. And if I have my_var |
and press the shortcut, the extension will not add a space, resulting in the exact same result my_var %>%
.Probably these are some small details that we can live without, but if that is possible to do with the native shortcut feature, it would be great.
The text-shortcuts extension is not compatible with JupyterLab 4.x.x. There are mainly two reasons for that:
jupyter labextension install
command is deprecated, and JupyterLab v4 only accepts installation via pip (related to #32)