lambdalisue / jupyter-vim-binding

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

Ctrl-S doesn't save in Firefox when in command-mode #73

Open edgimar opened 8 years ago

edgimar commented 8 years ago

The title says it all -- if you are in Jupyter mode, then Ctrl-S will save/checkpoint, but when in command mode, pressing Ctrl-S opens up a file-dialog asking where you want to save the HTML file.

lambdalisue commented 8 years ago

Use :w instead of <C-s> while you are in Command mode (Vim).

Jupyter provides (Ctrl-s) to save a checkpoint but this extension eliminate that mapping while :w works same

in Readme.

edgimar commented 8 years ago

That's probably a better keybinding anyway, but in the F1 help-screen Ctrl-S shows up as a valid keybinding for the command mode. By the way, I can't find any keybinding to split a cell that works -- none in the F1 help seem to work - have these also changed?

lambdalisue commented 8 years ago

but in the F1 help-screen Ctrl-S shows up as a valid keybinding for the command mode

I'm sorry but the term "Command mode" in the help points "Jupyter mode". Where you need to see is "Edit mode". This is a bigest complicated point of this plugin and I haven't been working on this... https://github.com/lambdalisue/jupyter-vim-binding/issues/56

By the way, I can't find any keybinding to split a cell that works -- none in the F1 help seem to work - have these also changed?

Ctrl-o,- would work for that.

selection_024

joelostblom commented 7 years ago

@edgimar It is possible to enable ctrl-s for saving by adding the following to .jupyter/custom/custom.js:

require([
  'nbextensions/vim_binding/vim_binding',
  'base/js/namespace',
], function(vim_binding, ns) {
  // Add post callback
  vim_binding.on_ready_callbacks.push(function(){
    var km = ns.keyboard_manager;
    // Indicate the key combination to run the commands
    km.edit_shortcuts.add_shortcut('ctrl-s', 'jupyter-notebook:save-notebook', true);
    // Update Help
    km.edit_shortcuts.events.trigger('rebuild.QuickHelp');
  });
});

@lambdalisue Not sure if there is a preferred way of adding the above shortcut, but in any case I believe you can close this issue.