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

VSCodeVim disables 'Open Folder' shortcut (Ctrl+K Ctrl+O) #4431

Closed
jyn514 opened this issue Dec 29, 2019 · 3 comments
Closed

VSCodeVim disables 'Open Folder' shortcut (Ctrl+K Ctrl+O) #4431

jyn514 opened this issue Dec 29, 2019 · 3 comments

Comments

@jyn514
Copy link

jyn514 commented Dec 29, 2019

Describe the bug
I open different project folders a lot and I would like to use the keyboard shortcut (the manual way is File -> Open Folder). However, whenever I enable VSCodeVim, nothing happens when I press Ctrl-K Ctrl-O.

To Reproduce

  1. Install VSCodeVim.
  2. Open a new file and click on it to make sure it is in focus.
  3. Press Ctrl-K then Ctrl-O.
  4. Nothing happens.

Note that if the file is not in focus (you last clicked on another part of the UI) the shortcut works fine.

Expected behavior
The 'Open Folder' dialog pops up.

Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: v1.12.4 (2019-12-27)
  • VSCode version:
Version: 1.41.1
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T15:04:31.999Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
  • OS: Linux x64 5.0.0-37-generic
@cvaldev
Copy link
Contributor

cvaldev commented Dec 29, 2019

As far as I know this happens because the extension disables the native Ctrl actions by default. You could set vim.useCtrlKeys to false. Or alternatively set this as a keybind in your settings:

"vim.normalModeKeyBindings": [
        {
            "before": [
                "<C-k>",
                "<C-o>"
            ],
            "commands": [
                "workbench.action.files.openFolder"
            ]
        },
        {
            "before": [
                "<C-o>"
            ],
            "commands": [
                "workbench.action.files.openFile"
            ]
        }
    ]

@J-Fields
Copy link
Member

If you don't care about vim's <C-k> and <C-o>, you can hand those back to VSCode with handleKeys (or useCtrlKeys, as @CVVPK mentioned). Best of both worlds is to remap via our settings (or a .vimrc) or in VSCode's settings with an appropriate when clause to avoid the conflict.

@jyn514
Copy link
Author

jyn514 commented Dec 29, 2019

Adding a setting for handleKeys in settings.json fixed it, thanks!

    "vim.handleKeys": {
        "<C-d>": true,
        "<C-k>": false,
        "<C-o>": false
    }

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

No branches or pull requests

3 participants