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

Access to KeybindingService in extension API #1432

Closed
aioutecism opened this issue Dec 18, 2015 · 5 comments
Closed

Access to KeybindingService in extension API #1432

aioutecism opened this issue Dec 18, 2015 · 5 comments
Labels
api feature-request Request for new features or functionality VIM VIM issue
Milestone

Comments

@aioutecism
Copy link
Contributor

I'm currently building an vim extension for vscode when I encountered this problem.
I need to bind keys such as i in Normal Mode and unbind it in Insert Mode so suggestions and other vscode's builtin features could work as normal.
In detail, my desired package.json can be:

{
    "contributes": {
        "keybindings": [
            {
                "command": "vim.i",
                "key": "i",
                "when": "editorTextFocus && !isVimInsertMode"
            },
            // ...
        ]
        // ...
    }
    // ...
}

It would be a great help if extension can access KeybindingService to register context to keybindings or bind/unbind in runtime.

ps: I can mimic all the default behaviours in Insert Mode, but that's just a lot of duplicate code and unnessery time.

@egamma egamma added VIM VIM issue api feature-request Request for new features or functionality labels Dec 18, 2015
@egamma egamma added this to the Backlog milestone Dec 18, 2015
@egamma
Copy link
Member

egamma commented Dec 18, 2015

@alexandrudima fyi

@alexdima
Copy link
Member

@aioutecism This is now possible on master. e.g.:

vscode.commands.executeCommand('setContext', 'isVimInsertMode', true);

Please see https://github.com/alexandrudima/vscode-vim if you are authoring a vim emulation extension for VS Code.

@alexdima alexdima modified the milestones: March 2016, Backlog Mar 12, 2016
@aioutecism
Copy link
Contributor Author

Cooooool!
When will the new version be released?

@alexdima
Copy link
Member

I think the insider version will be released tomorrow.

@aioutecism
Copy link
Contributor Author

@alexandrudima
Thanks!
Will update amVim as soon as possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality VIM VIM issue
Projects
None yet
Development

No branches or pull requests

3 participants