This repository was archived by the owner on Aug 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 136
Home
Alisue edited this page Dec 4, 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.
require(['codemirror/keymap/vim'], function() {
// Use Ctrl-h/l/j/k to move around in Insert mode
CodeMirror.Vim.map("<C-h>", "<Esc>i", "insert");
CodeMirror.Vim.map("<C-l>", "<Esc>lli", "insert");
CodeMirror.Vim.map("<C-j>", "<Esc>ji", "insert");
CodeMirror.Vim.map("<C-k>", "<Esc>ki", "insert");
// Use Ctrl-h/l/j/k to move around in Normal mode
// otherwise it would trigger browser shortcuts
CodeMirror.Vim.map("<C-h>", "h", "normal");
CodeMirror.Vim.map("<C-l>", "l", "normal");
CodeMirror.Vim.map("<C-j>", "j", "normal");
CodeMirror.Vim.map("<C-k>", "k", "normal");
});
require(['codemirror/keymap/vim'], function() {
CodeMirror.Vim.map("<C-a>", "ggVG", "normal");
});
require(['codemirror/keymap/vim'], 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"});
});
require(['base/js/namespace'], function(ns) {
ns.keyboard_manager.actions.call('jupyter-notebook:run-cell-and-insert-below');
});
Feel free to use this Wiki to share your tips