Last active
June 2, 2019 04:16
-
-
Save guerbai/877beb5898b1fb82f070064e20338987 to your computer and use it in GitHub Desktop.
jupyter打开vim编辑模式 #Jupyter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function enable_vim() { document.querySelectorAll(".CodeMirror").forEach(function (e) { e.CodeMirror.setOption("vimMode", true); }); } | |
document.addEventListener('keydown', function(e) { | |
if (e.keyCode == 13 && e.metaKey || e.keyCode == 13 && e.shiftKey) { | |
for (var i = 0; i < 10; i++) setTimeout(enable_vim, 1000 * i); | |
} | |
}); | |
enable_vim(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment