lambdalisue / jupyter-vim-binding

Jupyter meets Vim. Vimmer will fall in love.
2.1k stars 136 forks source link

Newest Jupyter breaks shortcuts (and extension) #13

Closed TyberiusPrime closed 8 years ago

TyberiusPrime commented 8 years ago

All the add_shortcut values have been renamed, from ipython.something to jupyter-notebook:something and some of the somethings changed as well.

Here's my working code // Assign custom Vim-like mappings km.edit_shortcuts.clear_shortcuts(); km.edit_shortcuts.add_shortcut('ctrl-shift--', 'jupyter-notebook:split-cell-at-cursor'); km.edit_shortcuts.add_shortcut('ctrl-shift-subtract', 'jupyter-notebook:split-cell-at-cursor'); km.edit_shortcuts.add_shortcut('ctrl-j', 'jupyter-notebook:select-next-cell'); km.edit_shortcuts.add_shortcut('ctrl-k', 'jupyter-notebook:select-previous-cell'); km.edit_shortcuts.add_shortcut('alt-enter', 'jupyter-notebook:run-cell-and-insert-below'); km.edit_shortcuts.add_shortcut('ctrl-enter', 'jupyter-notebook:run-cell'); km.edit_shortcuts.add_shortcut('shift-enter', 'jupyter-notebook:run-cell-and-select-next'); km.edit_shortcuts.add_shortcut('shift', 'jupyter-notebook:ignore'); km.edit_shortcuts.add_shortcut('ctrl-s', 'jupyter-notebook:save-notebook');

km.command_shortcuts.clear_shortcuts(); //km.command_shortcuts.add_shortcut('ctrl-c', 'jupyter-notebook:copy'); //km.command_shortcuts.add_shortcut('ctrl-c', 'jupyter-notebook:interrupt-kernel'); km.command_shortcuts.add_shortcut('shift-o', 'jupyter-notebook:insert-cell-above'); km.command_shortcuts.add_shortcut('o', 'jupyter-notebook:insert-cell-below'); km.command_shortcuts.add_shortcut('y,y', 'jupyter-notebook:copy-cell'); km.command_shortcuts.add_shortcut('d,d', 'jupyter-notebook:cut-cell'); km.command_shortcuts.add_shortcut('shift-p', 'jupyter-notebook:paste-cell-above'); km.command_shortcuts.add_shortcut('p', 'jupyter-notebook:paste-cell-below'); km.command_shortcuts.add_shortcut('esc', 'jupyter-notebook:close-pager'); km.command_shortcuts.add_shortcut('q', 'jupyter-notebook:close-pager'); km.command_shortcuts.add_shortcut('enter', 'jupyter-notebook:enter-edit-mode'); km.command_shortcuts.add_shortcut('i', 'jupyter-notebook:enter-edit-mode'); km.command_shortcuts.add_shortcut('j', 'jupyter-notebook:select-next-cell'); km.command_shortcuts.add_shortcut('k', 'jupyter-notebook:select-previous-cell'); km.command_shortcuts.add_shortcut('ctrl-j', 'jupyter-notebook:select-next-cell'); km.command_shortcuts.add_shortcut('ctrl-k', 'jupyter-notebook:select-previous-cell'); km.command_shortcuts.add_shortcut('shift-j', 'jupyter-notebook:extend-marked-cells-below'); km.command_shortcuts.add_shortcut('shift-k', 'jupyter-notebook:extend-marked-cells-above'); km.command_shortcuts.add_shortcut('shift-m', 'jupyter-notebook:merge-cells'); km.command_shortcuts.add_shortcut('g,g', 'vim_binding:focus_first_cell'); km.command_shortcuts.add_shortcut('shift-g', 'vim_binding:focus_last_cell'); km.command_shortcuts.add_shortcut('ctrl-u', 'jupyter-notebook:scroll-notebook-up'); km.command_shortcuts.add_shortcut('ctrl-d', 'jupyter-notebook:scroll-notebook-down'); km.command_shortcuts.add_shortcut('u', 'jupyter-notebook:undo-cell-deletion'); km.command_shortcuts.add_shortcut('ctrl-1', 'jupyter-notebook:change-cell-to-code'); km.command_shortcuts.add_shortcut('ctrl-2', 'jupyter-notebook:change-cell-to-markdown'); km.command_shortcuts.add_shortcut('ctrl-3', 'jupyter-notebook:change-cell-to-raw'); km.command_shortcuts.add_shortcut('shift-h', 'jupyter-notebook:show-keyboard-shortcuts'); km.command_shortcuts.add_shortcut('shift-l', 'jupyter-notebook:toggle-cell-line-numbers'); km.command_shortcuts.add_shortcut('shift-v', 'jupyter-notebook:toggle-cell-output-visibility'); km.command_shortcuts.add_shortcut('shift-s', 'jupyter-notebook:toggle-cell-output-scrolling'); km.command_shortcuts.add_shortcut('ctrl-s', 'jupyter-notebook:save-notebook');

lambdalisue commented 8 years ago

Thanks for reporting this issue. I should think about work around...

lambdalisue commented 8 years ago

Thanks for reporting. This issue should be fixed now.