Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.
Seb edited this page Dec 2, 2015 · 12 revisions

This wiki is a place to share snippets that enhance the usability of the vim - IPython integration, but aren't so general that they are part of the binding.

Selecting all

require(['nbextensions/vim_binding/vim_binding'], function() {
   CodeMirror.Vim.map("<C-a>", "ggVG", "normal");
});

Adding custom actions

require(['nbextensions/vim_binding/vim_binding'], function() {
  // a
  CodeMirror.Vim.defineAction("hello", function(){console.log("hello")});
  // 'a' is the key you map the action to
  CodeMirror.Vim.mapCommand("a", "action", "hello", {}, {context: "normal"}); 
});

Calling a Jupyter shortcut

require(['base/js/namespace'], function(ns) {
    ns.keyboard_manager.actions.call('jupyter-notebook:run-cell-and-insert-below');
});

Powerful resources

Clone this wiki locally