Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting codemirror shorcuts. #4591

Merged
merged 6 commits into from Nov 26, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions IPython/html/templates/notebook.html
Expand Up @@ -198,6 +198,7 @@
<li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li>
<li><a href="http://ipython.org/ipython-doc/stable/interactive/notebook.html" target="_blank">Notebook Help</a></li>
<li id="keyboard_shortcuts" title="Opens a tooltip with all keyboard shortcuts"><a href="#">Keyboard Shortcuts</a></li>
<li><a href="http://ipython.org/ipython-doc/dev/interactive/cm_keyboard.html" target="_blank">Editor Shortcuts</a></li>
<li class="divider"></li>
<li><a href="http://docs.python.org" target="_blank">Python</a></li>
<li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li>
Expand Down
42 changes: 42 additions & 0 deletions docs/source/interactive/cm_keyboard.rst
@@ -0,0 +1,42 @@
.. _cm_keyboard:

Some additional Codemirror keyboard shortcuts
=============================================

Because each cell of the IPython notebook is powered by Codemirror,
you can actually use a set of predetermined keyboard shortcuts to
write and manipulate your content easily:

================= ============== ==================
Action PC shortcut Mac shortcut
================= ============== ==================
newline & indent Enter Enter
toggle overwrite Insert Insert
indent Ctrl-] Cmd-]
dedent Ctrl-[ Cmd-[
select all Ctrl-A Cmd-A
delete line Ctrl-D Cmd-D
undo Ctrl-Z Cmd-Z
redo Ctrl-Shift-Z Cmd-Shift-Z
redo Ctrl-Y Cmd-Y
go to cell start Ctrl-Home Cmd-Up
go to cell start Alt-Up Cmd-End
go to cell start PageUp PageUp
go to cell end Ctrl-End ---
go to cell end Ctrl-Down Cmd-Down
go to cell end PageDown PageDown
go one word left Ctrl-Left Alt-Left
go one word right Ctrl-Right Alt-Right
go to line start Alt-Left Cmd-Left
go to line start Home Home
go to line end Alt-Right Cmd-Right
go to line end End End
del word before Ctrl-Backspace Alt-Backspace
del word after --- Ctrl-Alt-Backspace
del word after Ctrl-Delete Alt-Delete
================= ============== ==================

.. note::

These shorcuts are valid for US keyboards, so some shortcuts can change
for non-US keyboards.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit scary. Is it worth giving a brief idea or example of how things might change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in an US keyboard right now... but probably @Carreau can tell you more because I think he uses a French keyboard... and I had reports from German people having these problems too...
BUT, we can not document every shortcut for every language, so I thought to only document the most common one, the US...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially some shorcuts do not work in non-US keyboard... or you have to take a different combination of keys to get the same action...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to get an idea of which shortcuts might change. Also, if people using non-US keyboards will have a good sense from other software of how to adapt these shortcuts, or if we're doing something unusual.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that, I think this looks good now. We'll see if @Carreau has any input on the shortcut differences, otherwise we'll merge tomorrow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some issues with German Keyboard: #2653 (comment)
I do not think we are doing unusual things, just a codemirror-keyevent (keyboard) issue, I think...

1 change: 1 addition & 0 deletions docs/source/interactive/index.rst
Expand Up @@ -11,6 +11,7 @@ Using IPython for interactive work
shell
qtconsole
notebook
cm_keyboard
nbconvert
public_server

Expand Down
4 changes: 3 additions & 1 deletion docs/source/interactive/notebook.rst
Expand Up @@ -394,7 +394,9 @@ Ctrl-m . restart kernel
Ctrl-m h show keyboard shortcuts
============ ==========================


.. seealso::

:ref:`Some additional Codemirror keyboard shortcuts <cm_keyboard>`



Expand Down