技术小黑屋

Use Vim in StackEdit

StackEdit is really great online editor. It could connect with Google Drive. And what’s more, you can even use Vim in this editor.
Now add the following snippet into SettingsExtensionsUserCustom extension javascript area.

linenos:false
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
userCustom.onReady = function() {
        var ace = {}
        ace.require = require
        ace.define = define
    ace.require(["ace/lib/net"], function(acenet) {
        acenet.loadScript("https://rawgit.com/androidyue/resources/master/keybinding-vim.js", function() {
                        e = document.querySelector(".ace_editor").env.editor
            ace.require(["ace/keyboard/vim"], function(acevim) {
                                e.setKeyboardHandler(acevim.handler);

            });

        });

    });
        window.ace = ace;

};

Others


我的知乎 Live 推荐