Skip to content

Commit 581de0e

Browse files
committed
Update pocketvim.md
1 parent 65b885e commit 581de0e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tips/pocketvim.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11

22
https://github.com/NickTomlin/pocketvim
33

4+
5+
6+
```
7+
you can get editor editor object with
8+
document.querySelector(".ace_editor.ace-github").env.editor
9+
but setKeyboardHandler won't work since they use old ace version, so
10+
you need to do this
11+
12+
ace.require("ace/lib/net").loadScript("https://rawgithub.com/ajaxorg/ace-builds/master/src-min-noconflict/keybinding-vim.js",
13+
function() {
14+
e = document.querySelector(".ace_editor.ace-github").env.editor;
15+
e.setKeyboardHandler(ace.require("ace/keyboard/vim").handler);
16+
})
17+
```

0 commit comments

Comments
 (0)