techrah / jupyterext-text-shortcuts

A Jupyter Lab extension for keyboard text shortcuts
MIT License
50 stars 11 forks source link

Shortcuts no longer working in new conda virtual env #7

Closed josh-friedlander-kando closed 4 years ago

josh-friedlander-kando commented 4 years ago

Firstly, thanks for your very useful extension!

I've been using it successfully for a while, and recently switched to using JupyterLab in a new conda env. I had to install all my extensions afresh, but my user shortcuts seem to have been saved somewhere. However, none of the text-shortcuts:insert-text commands work. It is valid JSON, the keys aren't reserved (they were working before), so I'm quite puzzled by what's gone wrong. Any ideas?

Here's my full Keyboard Shortcuts User Preferences:

{
    "shortcuts": [
        {
            "command": "notebook:hide-cell-outputs",
            "keys": [
                "O"
            ],
            "selector": ".jp-Notebook:focus"
        },    
        {
            "command": "notebook:show-cell-outputs",
            "keys": [
                "O", 
                "O"
            ],
            "selector": ".jp-Notebook:focus"
        },    

                {
            "command": "text-shortcuts:insert-text",
            "args": {
                "text": "pd.options.display.max_rows = 999\npd.options.display.max_columns = 99\nplt.style.use('seaborn-pastel')",
                "autoPad": false
            },
            "keys": [
                "Alt ["
            ],
            "selector": "body"
        },
        {
            "command": "text-shortcuts:insert-text",
            "args": {
                "text": "f, ax = plt.subplots(figsize=(15, 5))\ndf['value'].plot(ax=ax);",
                "autoPad": false
            },
            "keys": [
                "Alt ]"
            ],
            "selector": "body"
        }

    ]
}
techrah commented 4 years ago

Hi @josh-friedlander-kando. I just created a new conda virtual env and tried your JSON and it's working for me. Is this still an issue for you?

If you haven't tried yet, please uninstall the plugin and re-install to force a rebuild of JupyterLab.

josh-friedlander-kando commented 4 years ago

I had tried that and it didn't work, but now I tried deleted the env and creating a new one and it worked. I guess there was something else interfering with it, but no idea what it was.

Sorry for the vague and unreproducible bug! :(

techrah commented 4 years ago

No worries. Glad you got it working.