You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, `editor` is initialized instance of monaco editor and the 2nd argument should be the node where you would like to place/show the VIM status info.
@@ -50,65 +51,83 @@ If you are following the official guide and integrating the AMD version of `mona
require(["vs/editor/editor.main", "monaco-vim"], function (a, MonacoVim) {
74
+
var editor =monaco.editor.create(
75
+
document.getElementById("container"),
76
+
{
77
+
value: [
78
+
"function x() {",
79
+
'\tconsole.log("Hello world!");',
80
+
"}",
81
+
].join("\n"),
82
+
language:"javascript",
83
+
}
84
+
);
85
+
var statusNode =document.getElementById("status");
86
+
var vimMode =MonacoVim.initVimMode(editor, statusNode);
87
+
88
+
// remove vim mode by calling
89
+
// vimMode.dispose();
90
+
});
91
+
</script>
92
+
</body>
87
93
</html>
88
94
```
89
95
90
-
See [demo.js](https://github.com/brijeshb42/monaco-vim/tree/master/src/demo.js) for full usage.
96
+
See [demo.ts](https://github.com/brijeshb42/monaco-vim/tree/master/src/demo.ts) for full usage.
97
+
98
+
If you would like to customize the statusbar or provide your own implementation, see `initVimMode`'s implementation in [src/index.ts](https://github.com/brijeshb42/monaco-vim/tree/master/src/index.ts).
99
+
100
+
### Development
91
101
92
-
If you would like to customize the statusbar or provide your own implementation, see `initVimMode`'s implementation in [src/index.js](https://github.com/brijeshb42/monaco-vim/tree/master/src/index.js).
102
+
```sh
103
+
pnpm install
104
+
pnpm dev
105
+
```
106
+
107
+
The demo runs on Vite at http://localhost:8080. Build the distributable bundle with:
For advanced usage, refer [codemirror](https://github.com/codemirror/CodeMirror/issues/2840#issuecomment-58125831). `CodeMirror.Vim` is available as `VimMode.Vim`;
131
+
For advanced usage, refer [codemirror](https://github.com/codemirror/CodeMirror/issues/2840#issuecomment-58125831). `CodeMirror.Vim` is available as `VimMode.Vim`;
113
132
114
133
This implementaion of VIM is a layer between Codemirror's VIM keybindings and monaco. There may be issues in some of the keybindings, especially those that expect extra input like the Ex commands or search/replace. If you encounter such bugs, create a new [issue](https://github.com/brijeshb42/monaco-vim/issues). PRs to resolve those are welcome too.
0 commit comments