Skip to content

Commit e2d786c

Browse files
authored
[vim bindings] Document events fired by vim mode
1 parent 3008203 commit e2d786c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/manual.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<li><a href="#vimapi">Vim Mode API</a>
5959
<ul>
6060
<li><a href="#vimapi_configuration">Configuration</a></li>
61+
<li><a href="#vimapi_events">Events</a></li>
6162
<li><a href="#vimapi_extending">Extending VIM</a></li>
6263
</ul>
6364
</li>
@@ -3559,6 +3560,21 @@ <h3 id="vimapi_configuration">Configuration</h3>
35593560
</dd>
35603561
</dl>
35613562

3563+
<h3 id="vimapi_events">Events</h3>
3564+
3565+
<p>VIM mode signals a few events on the editor instance. For an example usage, see <a href="https://github.com/codemirror/CodeMirror/blob/5.55.0/demo/vim.html#L101-L110">demo/vim.html#L101</a>.</p>
3566+
3567+
<dl>
3568+
<dt id="vimapi_commanddone"><code><strong>"vim-command-done"</strong> (reason: undefined)</code></dt>
3569+
<dd>Fired on keypress and mousedown where command has completed or no command found.</dd>
3570+
3571+
<dt id="vimapi_keypress"><code><strong>"vim-keypress"</strong> (vimKey: string)</code></dt>
3572+
<dd>Fired on keypress, <code>vimKey</code> is in Vim's key notation.</dd>
3573+
3574+
<dt id="vimapi_modechange"><code><strong>"vim-mode-change"</strong> (modeObj: object)</code></dt>
3575+
<dd>Fired after mode change, <code>modeObj</code> parameter is a <code>{mode: string, ?subMode: string}</code> object. Modes: <code>"insert", "normal", "replace", "visual"</code>. Visual sub-modes: <code>"linewise", "blockwise"</code>.</dd>
3576+
</dl>
3577+
35623578
<h3 id="vimapi_extending">Extending VIM</h3>
35633579

35643580
<p>CodeMirror's VIM mode implements a large subset of VIM's core

0 commit comments

Comments
 (0)