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

Open in Vim with keyboard shortcut #5

Closed
fresh2dev opened this issue Feb 23, 2024 · 1 comment · Fixed by #6
Closed

Open in Vim with keyboard shortcut #5

fresh2dev opened this issue Feb 23, 2024 · 1 comment · Fixed by #6

Comments

@fresh2dev
Copy link

Thanks for the stellar plugin! I've been dreaming about something like this for a while, but it seems to fall short in one area, and it's sort of ironic: I can't open in Vim with a keyboard shortcut.

I can right click > "Open with Vim..." and all is well. But when I define a keyboard shortcut, it does not work.

keybindings.json

[
    {
        "key": "o",
        "command": "vscode-open-with-vim.openWithVim",
        "when": "explorerViewletFocus && foldersViewVisible && !inputFocus"
    }
]

With this, when I press "o" in the file explorer, VSCode reports this error:

Cannot read properties of undefined (reading 'toString')

Any ideas?

@babakks
Copy link
Owner

babakks commented Apr 28, 2024

@fresh2dev Thanks for reporting this, and sorry for the delay. The solution to this is a bit hacky, because at the moment VS Code does not provide an API to get the selected file in the explorer tree. You can see the long discussion here.

Anyway, I managed to use one of the suggestions in the mentioned thread to make this work. I just published a new version of the extension. Could you please upgrade to v0.0.5, and let me know if this works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants