Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

How can I map command + b to run cell, insert below in vim normal mode #150

Open
wsh3776 opened this issue Mar 3, 2020 · 0 comments
Open

Comments

@wsh3776
Copy link

wsh3776 commented Mar 3, 2020

The original shortcut is option + Enter, Can I change it to command + b

I have tried the following code, but it doesn't work, can you help me. Or can you give me more example of how to map in custom.js

// run cell, insert below

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;
    // Allow Ctrl-2 to change the cell mode into Markdown in Vim normal mode
    km.edit_shortcuts.add_shortcut('<C-b>', 'vim-binding:run-cell-insert-blow', true);
    // Update Help
    km.edit_shortcuts.events.trigger('rebuild.QuickHelp');
  });
});
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant