I have been trying to enable line wrapping in ipython notebook. I googled it with no results and i typed ipython notebook --help in a terminal. This gives me a ton of configurat
As @Matt pointed out you have to configure CodeMirror to enable wrapping.
However, this can be achieved by simply adding the following line to your custom.js
:
IPython.Cell.options_default.cm_config.lineWrapping = true;
So there is no need to loop through all the cells.
In a similar fashion you can enable line numbers, set the indentation depth and so on (see the link posted by @Matt for other options). The location of your custom.js
depends on your OS (on my Ubuntu machine it is ~/.ipython/profile_default/static/custom
).
In IPython 3 the plain call does not work any more, thus it is required to place the setting within an appropriate event handler. A possible solution could look like:
define([
'base/js/namespace',
'base/js/events'
],
function(IPython, events) {
events.on("app_initialized.NotebookApp",
function () {
IPython.Cell.options_default.cm_config.lineWrapping = true;
}
);
}
);