|
|
|
|
@ -7,19 +7,19 @@ Customize keymaps
|
|
|
|
|
which is not guaranteed to be kept in future versions of the notebook,
|
|
|
|
|
and can be removed or changed without warnings.
|
|
|
|
|
|
|
|
|
|
The notebook shortcuts that are defined by jupyter both in edit mode and command
|
|
|
|
|
mode are configurable in the frontend configuration file
|
|
|
|
|
``~/.jupyter/nbconfig/notebook.json``. The modification of Keyboard shortcut
|
|
|
|
|
suffer of several limitations, mainly that your Browser and OS might prevent
|
|
|
|
|
certain shortcut to work correctly. If this is the case, there are
|
|
|
|
|
unfortunately not much than can be done. The second issue can arise with
|
|
|
|
|
keyboard that have a layout different than US English. Again even if we are
|
|
|
|
|
aware of the issue, there is not much we can do about that.
|
|
|
|
|
The notebook shortcuts that are defined by jupyter both in edit mode and
|
|
|
|
|
command mode are configurable in the frontend configuration file
|
|
|
|
|
``~/.jupyter/nbconfig/notebook.json``. The modification of keyboard
|
|
|
|
|
shortcuts suffers from several limitations, mainly that your Browser and OS
|
|
|
|
|
might prevent certain shortcuts from working correctly. If this is the case,
|
|
|
|
|
there is unfortunately not much that can be done. The second issue can arise
|
|
|
|
|
with keyboards that have a layout different than US English. Again, even if
|
|
|
|
|
we are aware of the issue, there is not much that can be done.
|
|
|
|
|
|
|
|
|
|
Shortcut are also limited by the underlying library that handle code and text
|
|
|
|
|
edition: CodeMirror. If some Keyboard shortcuts are conflicting, the method
|
|
|
|
|
describe below might not work to create new keyboard shortcuts, especially in
|
|
|
|
|
the ``edit`` mode of the notebook.
|
|
|
|
|
Shortcuts are also limited by the underlying library that handles code and
|
|
|
|
|
text editing: CodeMirror. If some keyboard shortcuts are conflicting, the
|
|
|
|
|
method described below might not work to create new keyboard shortcuts,
|
|
|
|
|
especially in the ``edit`` mode of the notebook.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The 4 sections of interest in ``~/.jupyter/nbconfig/notebook.json`` are the
|
|
|
|
|
@ -30,15 +30,16 @@ following:
|
|
|
|
|
- ``keys.command.bind``
|
|
|
|
|
- ``keys.edit.bind``
|
|
|
|
|
|
|
|
|
|
The first two section describe which default keyboard shortcut not to register
|
|
|
|
|
at notebook startup time. These are mostly useful if you need to ``unbind`` a
|
|
|
|
|
default keyboard shortcut before binding it to a new ``command``.
|
|
|
|
|
The first two sections describe which default keyboard shortcuts not to
|
|
|
|
|
register at notebook startup time. These are mostly useful if you need to
|
|
|
|
|
``unbind`` a default keyboard shortcut before binding it to a new
|
|
|
|
|
``command``.
|
|
|
|
|
|
|
|
|
|
These two first sections apply respectively to the ``command`` and ``edit``
|
|
|
|
|
mode of the notebook. They take a list of shortcut to ``unbind``.
|
|
|
|
|
The first two sections apply respectively to the ``command`` and ``edit``
|
|
|
|
|
mode of the notebook. They take a list of shortcuts to ``unbind``.
|
|
|
|
|
|
|
|
|
|
For example, to unbind the shortcut to split a cell at the position of the
|
|
|
|
|
cursor (``Ctrl-Shift-Minus``)use the following:
|
|
|
|
|
cursor (``Ctrl-Shift-Minus``) use the following:
|
|
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
|
|
|
|
|
@ -57,16 +58,16 @@ cursor (``Ctrl-Shift-Minus``)use the following:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The last two section describe which new keyboard shortcut to register
|
|
|
|
|
at notebook startup time, and which actions they trigger.
|
|
|
|
|
The last two sections describe which new keyboard shortcuts to register
|
|
|
|
|
at notebook startup time and which actions they trigger.
|
|
|
|
|
|
|
|
|
|
These two last sections apply respectively to the ``command`` and ``edit``
|
|
|
|
|
The last two sections apply respectively to the ``command`` and ``edit``
|
|
|
|
|
mode of the notebook. They take a dictionary with shortcuts as ``keys`` and
|
|
|
|
|
``commands`` name as value.
|
|
|
|
|
|
|
|
|
|
For example, to bind the shortcut ``G,G,G`` (Press G three time in a row) in
|
|
|
|
|
command mode, to the command that restart the kernel and run all cells, use the
|
|
|
|
|
following:
|
|
|
|
|
command mode to the command that restarts the kernel and runs all cells, use
|
|
|
|
|
the following:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code:: javascript
|
|
|
|
|
@ -86,5 +87,5 @@ following:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The name of the available ``commands`` can be find by hovering the right end of
|
|
|
|
|
a row in the command palette.
|
|
|
|
|
The name of the available ``commands`` can be find by hovering over the
|
|
|
|
|
right end of a row in the command palette.
|
|
|
|
|
|