Turn off auto-closing parentheses in ipython

@minrk’s answer is the meat and bones of the fix, but you’ll need to wrap it in an initialization callback, at least with IPython-3.1.0. In your custom.js:

require(['base/js/namespace', 'base/js/events'], function(IPython, events) {
  events.on('app_initialized.NotebookApp', function() {
    IPython.CodeCell.options_default.cm_config.autoCloseBrackets = false;
  });
});

Thanks @Mike for your comment about IPython’s RequireJS dependency loading and the pointer to a better formulation at IPython/Jupyter Installing Extensions.

Edit for Jupyter 4.0.x:

The current IPython notebook implementation, Jupyter 4.0.0, revamped JS customizations. It now uses ~/.jupyter/custom/custom.js by default, and you’ll need to replace that whole require(... events.on(...)) snippet with just the following in global scope:

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

Likewise, if you want to use jQuery to manipulate anything, just use the jQuery global directly. For example, I like to hide the fixed header by default, which gives me another 40px of space for my code, which I find a bit more valuable than looking at the Jupyter logo all the time:

jQuery('#header-container').hide();

Edit for Jupyter ≥ 4.0.6 (but < Jupyter Lab):

If the custom.js solution above doesn’t work, try adding the following to your ~/.jupyter/nbconfig/notebook.json:

{
  "CodeCell": {
    "cm_config": {
      "autoCloseBrackets": false
    }
  }
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)