Search code examples
visual-studio-codejupyterline

Insert new line below in VScode with Jupyter


How to insert a new line below in a cell with "shift+enter" in VScode with Jupyter!

I try to edit key bindings but it does not make any change!

preview


Solution

  • This is how I fixed it, "keybindings.json" file

    [
        {
            "key": "shift+enter",
            "command": "editor.action.insertLineAfter",
            "when": "editorTextFocus && !editorReadonly"
        },
        {
            "key": "ctrl+enter",
            "command": "-editor.action.insertLineAfter",
            "when": "editorTextFocus && !editorReadonly"
        },
        {
            "key": "ctrl+enter",
            "command": "python.execInTerminal"
        },
        {
            "key": "shift+enter",
            "command": "-notebook.cell.executeAndSelectBelow",
            "when": "notebookCellListFocused && notebookCellType == 'markdown' || notebookCellListFocused && notebookCellExecutionState == 'failed' || notebookCellExecutionState == 'idle' || notebookCellExecutionState == 'succeeded' && notebookKernelCount > 0"
        },
        {
            "key": "ctrl+enter",
            "command": "notebook.cell.execute",
            "when": "notebookCellListFocused && notebookCellType == 'code' && notebookCellExecutionState == 'failed' || notebookCellExecutionState == 'idle' || notebookCellExecutionState == 'succeeded' && notebookKernelCount > 0"
        },
        {
            "key": "ctrl+alt+enter",
            "command": "-notebook.cell.execute",
            "when": "notebookCellListFocused && notebookCellType == 'code' && notebookCellExecutionState == 'failed' || notebookCellExecutionState == 'idle' || notebookCellExecutionState == 'succeeded' && notebookKernelCount > 0"
        }
    ]