Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offer external API so other plugins can interact with the vim emulation layer #5073

Open
J-Fields opened this issue Jul 24, 2020 · 4 comments

Comments

@J-Fields
Copy link
Member

As described here, extensions can offer APIs for other extensions to use. I'm inclined to keep this small and uncontroversial at first. We can always expand as needed, but breaking changes to external APIs are always a pain.

function getMode(): Mode;
function setMode(Mode): void;

Open question: what else should be included?

@nickcernis
Copy link

nickcernis commented Jul 24, 2020

Thanks for opening this, @J-Fields! setMode(Mode) would be useful to me.

My use case is to contribute to a plugin called edamagit (a recreation of Emacs' Magit interface).

The plugin opens a COMMIT_EDITMSG buffer/tab to enter your commit message when you commit files. By default that tab opens in normal mode (unless vim.startInInsertMode is true, but that setting applies to all files). It would ease the workflow to switch to insert mode when the commit buffer is opened so VsCodeVim users can just start typing straight away (this is also the typical behaviour in Emacs).

@stevenguh
Copy link
Contributor

getMode(Mode) will be helpful to perform different action based on what's the current vim mode for VSpaceCode. The other things I would love to have is to have API to perform action directly (e.g. trigger easy motion jump) instead of calling vim.remap command.

@stevenguh
Copy link
Contributor

Also, access to registers and search would also be nice to build other features on top

@waynewaynetsai
Copy link
Contributor

waynewaynetsai commented Sep 15, 2021

@J-Fields Public keypress event and type api for other extensions will be very useful.
Currently other extension's type command can not work together with vscodevim.

See also:

  1. Multiple extensions registering the 'type' command
  2. Expose keyup/keydown events to extensions

@J-Fields J-Fields added this to the Backlog milestone Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants