VSCode Vim plugin folding ctrl+k ctrl+<number>
Asked Answered
B

1

6

I'm using VSCode with Vim extension enabled.

By default, VSCode Ctrl+K Ctrl+number would fold the code of the entire file to the indent level set by the number.

VSCode default folding commands

This is EXTREMELY useful for me, and I use it all the time.

The problem is: with the Vim extension enabled, those commands doesn't work anymore.

This extension also doesn't allow (as far as I know) to change configurations such as ":set foldmethod=indent".

Are there any workarounds?

Thank you very much!

Barbrabarbuda answered 29/3, 2021 at 14:8 Comment(0)
B
10

ORIGINAL SOLUTION:

The most simple solution I found was to disable Vim: Use Ctrl Keys at

Settings > Extensions > Vim > Vim: Use Ctrl Keys

(you can type "vim ctrl" in the search bar to find it faster).

VSCode Settings > Vim: Use Ctrl Keys

You can also add "vim.useCtrlKeys": false, directly in your settings.json.

It's good enough for me, but be aware that it can mess up your Vim commands, as it will not use any Ctrl commands anymore.


MUCH BETTER SOLUTION:

Just put this in settings.json!

"vim.handleKeys": {
    "<C-k>": false
},
Barbrabarbuda answered 30/3, 2021 at 20:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.