Skip to content
New issue

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

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

Already on GitHub? # to your account

[select_keymap] Add note about helpful firefox extension #845

Merged
merged 1 commit into from
Jan 26, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Select CodeMirror Keymap
=======

This extension lets you choose between the available CodeMirror keymaps: default, emacs, vim, and sublime
This extension lets you choose between the available CodeMirror keymaps: default, emacs, vim, and sublime.

There's a chance that this might cause key conflicts, especially with other extensions
There's a chance that this might cause key conflicts, especially with other extensions.

Most browsers consume some of the global keybindings like `Ctrl+n`. [The Menu Wizard add-on for Firefox](https://addons.mozilla.org/en-US/firefox/addon/s3menu-wizard/) allows you to disable some of the global key shortcuts, thus passing the keys through to CodeMirror.

![Demo](select_keymap.png)

Based on:
* [jupyter-emacskeys](https://github.com/rmcgibbo/jupyter-emacskeys)
* [notebook_input_mode](https://github.com/asford/notebook_input_mode)
* [notebook_input_mode](https://github.com/asford/notebook_input_mode)
28 changes: 14 additions & 14 deletions src/jupyter_contrib_nbextensions/nbextensions/select_keymap/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,38 @@ define([
"Ctrl-[": "leave_current_mode"
},
command_shortcuts: {
"ctrl-c": "jupyter-notebook:interrupt-kernel",
"ctrl-z": "jupyter-notebook:restart-kernel",
"Ctrl-c": "jupyter-notebook:interrupt-kernel",
"Ctrl-z": "jupyter-notebook:restart-kernel",

"d,d": "jupyter-notebook:cut-cell",
"y,y": "jupyter-notebook:copy-cell",
"u": "jupyter-notebook:undo-cell-deletion",

"p": "jupyter-notebook:paste-cell-below",
"shift-p": "jupyter-notebook:paste-cell-above",
"Shift-P": "jupyter-notebook:paste-cell-above",

"o": "jupyter-notebook:insert-cell-below",
"shift-o": "jupyter-notebook:insert-cell-above",
"Shift-O": "jupyter-notebook:insert-cell-above",

"i": "jupyter-notebook:enter-edit-mode",
"enter": "jupyter-notebook:enter-edit-mode",
"Enter": "jupyter-notebook:enter-edit-mode",

"shift-j": "jupyter-notebook:move-cell-down",
"shift-k": "jupyter-notebook:move-cell-up",
"Shift-J": "jupyter-notebook:move-cell-down",
"Shift-K": "jupyter-notebook:move-cell-up",

"shift-/": "jupyter-notebook:show-keyboard-shortcuts",
"Shift-/": "jupyter-notebook:show-keyboard-shortcuts",
"h": "jupyter-notebook:toggle-cell-output-collapsed",
"shift-h": "jupyter-notebook:toggle-cell-output-scrolled",
"Shift-H": "jupyter-notebook:toggle-cell-output-scrolled",

"`": "jupyter-notebook:change-cell-to-code",
"0": "jupyter-notebook:change-cell-to-markdown"
},
edit_shortcuts: {
"shift-esc": "jupyter-notebook:enter-command-mode"
"Shift-Esc": "jupyter-notebook:enter-command-mode"
}
},
remove: {
edit_shortcuts: ["esc"]
edit_shortcuts: ["Esc"]
},
custom: function() {
disable_keyboard_manager_in_dialog(this);
Expand All @@ -92,8 +92,8 @@ define([
"Ctrl-Y": "yank_no_selection"
},
command_shortcuts: {
"ctrl-n": "jupyter-notebook:select-next-cell",
"ctrl-p": "jupyter-notebook:select-previous-cell",
"Ctrl-N": "jupyter-notebook:select-next-cell",
"Ctrl-P": "jupyter-notebook:select-previous-cell",
"Alt-X": "jupyter-notebook:show-command-palette"

},
Expand All @@ -102,7 +102,7 @@ define([
}
},
remove: {
edit_shortcuts: ["ctrl-shift-minus"],
edit_shortcuts: ["Ctrl-Shift-Minus"],
keyMap: ["Ctrl-V"]
},
custom: function() {
Expand Down