Issue
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:
Solution
It looks like it can be done by running in a notebook:
from notebook.services.config import ConfigManager
c = ConfigManager()
c.update('notebook', {"CodeCell": {"cm_config": {"autoCloseBrackets": False}}})
This creates a file ~/.jupyter/nbconfig/notebook.json
with the content:
{
"CodeCell": {
"cm_config": {
"autoCloseBrackets": false
}
}
}
After executing the Python command, or manually creating the file, restart your Jupyter notebook, and it should stop auto-closing quotes and brackets.
Answered By - Marc Garcia
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.