How to disable auto-quotes and auto-brackets in Jupyter 5.0

Viewed 22170

I upgraded Jupyter to the latest vesion, 5.0, and it looks like my front-end configuration stopped working.

I don't understand why Jupyter comes with auto closing quotes and brackets by default, which I find pretty annoying. So, at each version I have to change the settings to disable it.

It used to work by creating a file ~/.jupyter/custom/custom.js and adding the next JavaScript code:

require(['notebook/js/codecell'], function (codecell) {
  codecell.CodeCell.options_default.cm_config.autoCloseBrackets = false;
})

I've read that since Jupyter 4 this code could be changed by:

IPython.CodeCell.options_default.cm_config.autoCloseBrackets = false;

But it looks like in Jupyter 5, the two previous options stopped working.

The documentation I found regarding the front-end configuration is not helpful (I'll be happy to improve it once I understand it):

http://jupyter-notebook.readthedocs.io/en/latest/frontend_config.html#frontend-config

Can anyone help me understand how to disable auto-brackets and auto-quotes in Jupyter 5 please?

This is the exact version I'm running:

enter image description here

4 Answers

For JupyterLab visitors there is a "User Preferences" panel of the "Notebook" settings editor into which you paste & save:

{
  "codeCellConfig": {
    "autoClosingBrackets": false
  }
}

Open with Ctrl + , or via menu: Settings → Advanced Settings Editor & click "Notebook"

You can simply got to Settings tab and uncheck Auto Close Brackets option to disable auto-complete or check it to enable auto-complete

Here is my 2 jpgs:

[step 1] Go to "Advanced Settings" under "Settings" in menu:

"Advanced Settings" under "Settings"

[step 2] Select the "Notebook" category, in the "User Preference" tab, add text as follows: (just follow the syntax shown in the "System Defaults" tab):

{
    "codeCellConfig": {
        "autoClosingBrackets": false,
    },   
}

add text as follows in the "User Preference"

FYI:

!jupyter --version

jupyter core     : 4.7.1
jupyter-notebook : 6.3.0
qtconsole        : 5.0.3
ipython          : 7.22.0
ipykernel        : 5.3.4
jupyter client   : 6.1.12
jupyter lab      : 3.0.14
nbconvert        : 6.0.7
ipywidgets       : 7.6.3
nbformat         : 5.1.3
traitlets        : 5.0.5
Related