Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any shortcut to insert a new line below the current line? #8065

Open
Roffild opened this issue Mar 21, 2020 · 6 comments
Open

Is there any shortcut to insert a new line below the current line? #8065

Roffild opened this issue Mar 21, 2020 · 6 comments
Milestone

Comments

@Roffild
Copy link

Roffild commented Mar 21, 2020

jupyter/notebook#3918

In JupyterLab, I tried to change the behavior using this config:

{
    "shortcuts": [
        {
            "command": "console:linebreak",
            "keys": [
                "Ctrl Enter"
            ],
            "selector": ".jp-Notebook.jp-mod-editMode"
        },
           {
            "command": "notebook:run-cell",
            "keys": [
                "Enter"
            ],
            "selector": ".jp-Notebook.jp-mod-editMode"
        }
     ]
}

I probably need the option "notebook:linebreak", which is not there.

@jasongrout
Copy link
Contributor

jasongrout commented Mar 21, 2020

Doesn't Enter insert a new line below the current line in the notebook?

edit: well, it inserts a new line at the cursor position. In your scenario, where is the cursor before and after the command?

@Roffild
Copy link
Author

Roffild commented Mar 21, 2020

The Jupyter QtConsole documentation in the "Multiline editing" section has an excellent description of the behavior of the code editor.

https://github.com/jupyter/qtconsole/blob/f65369c602a659ad0e3bb6e87ccc4df50ba2907c/qtconsole/usage.py#L26

I would like to have a full implementation of the Jupyter QtConsole behavior in JupyterLab Web.

@jasongrout
Copy link
Contributor

I think we have some of that already in the Console, which is the analog to the qt console in JupyterLab. We'd welcome discussion and PRs to make it better, of course!

@jasongrout jasongrout added this to the Future milestone Mar 22, 2020
@jasongrout
Copy link
Contributor

It's still not clear to me exactly what you are advocating for, though. Are you advocating for changes in the notebook, or the JupyterLab console? You mention qt console, so that would be most similar to the JupyterLab console, but you brought up the notebook above, so I'm confused.

@Roffild
Copy link
Author

Roffild commented Mar 22, 2020

To create Python scripts, Pycharm suited me. But the statistical syntax analyzer does not work well with Pandas. Now I am looking for an alternative.

I tried JupyterLab Web first, but the code execution behavior didn't work for me.

Tried Jupyter QtConsole today. I liked the method of running the code.

@jasongrout
Copy link
Contributor

Thanks for the extra context. Try the Code Console in JupyterLab for similar behavior: https://jupyterlab.readthedocs.io/en/stable/user/code_console.html

Adjust the way enter/shift-enter works by changing the "Console Run Keystroke" in the settings menu.

Or keep using qt console if you're happy with it, of course. It's a fine Jupyter frontend as well!

@jasongrout jasongrout modified the milestones: Future, Reference Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants