Vim icon indicating copy to clipboard operation
Vim copied to clipboard

VSCode Zen Mode Shortcut not working

Open xlaech opened this issue 9 years ago • 16 comments

In the newer versions of VSCode they added a shortcut for the Zen-Mode. If you press ctrl+k z, the zen-mode is toggled.

However with VSCodeVim enabled, the shortcut does not work. I do not know any ctrl+k vim shortcuts, but maybe there are. Is this behavior expected?

Environment:

  • VSCode Version: 0.7.1
  • VsCodeVim Version: 1.12.2
  • OS: Linux Mint 18 (But also, Windows, Mac)

What happened: Nothing

What did you expect to happen: Zen-Mode to toggle. If you remap to something else it works.

How to reproduce it:

  1. open vscode
  2. press ctrl+k z

xlaech avatar May 19 '17 04:05 xlaech

I think we should just not capture <C-k>. We don't actually use it anywhere, but we're capturing it for w.e. reason.

Chillee avatar May 19 '17 05:05 Chillee

Then i think, we should remove this. On mac and linux you actually have build in fullscreen modes, but on windows this is really i feature i miss (and therefore always remap).

xlaech avatar May 19 '17 05:05 xlaech

One thing you can do is use

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

Chillee avatar May 19 '17 05:05 Chillee

That is actually a better option, than changing the original shortcut. Thank you. Still it would probably better, to just not capture it in the first place.

xlaech avatar May 19 '17 05:05 xlaech

Oddly hit by this one, since I see the fix was made but then reverted.

Sticking the handleKeys setting in!

gaving avatar Oct 23 '17 10:10 gaving

@gaving Haha it's because I thought we could do it, but it turns out that <ctrl-k> was captured for a reason: lots of people like to bind <ctrl-w> k to <ctrl-k>. At some point, re-examining how we bind keys should definitely be something we do.

Chillee avatar Oct 23 '17 19:10 Chillee

Just my $0.02, but if people are making a non-standard remap which is not part of normal vim, why is this reason to capture that keystroke? Since ctrl-k is a VERY standard keystroke in vscode and NOT in vim it seems like the standard behavior should be supported and people who want to do something special should figure out how to do the weird thing. Currently anybody who wants to use the usual ctrl-k stuff in vscode has to figure out a way around when that is more standard (from the standard vscode and the standard vim) than using ctrl-k as a replace for ctrl-w k...

plbowers avatar Oct 28 '17 16:10 plbowers

@plbowers I agree that that's probably the right thing to do. Unluckily, the only way to currently do it is to modify handleKeys to set <c-k> to false. Now, maybe we should be shipping with values in it by default.

Chillee avatar Oct 28 '17 20:10 Chillee

@Chillee Could you add that to the plugin documentation, so other people will find this information easier?

solcanmihai avatar Sep 04 '18 05:09 solcanmihai

Feel free to submit a PR.

jpoon avatar Sep 04 '18 06:09 jpoon

Can we re-open this? Why was the fix reverted? How can I help?

I'm brand new to vscode as of yesterday. I come from vim, so I use the vim bindings. Meanwhile zen mode is awesome!

But I got hit by this issue. Since vim keybindings are a "standard feature" (by which I mean they appeared on the very first getting started screen I saw as an option, and as a vim user were a major selling point for me) and Zen Mode is also, it's quite confusing that the key binding shown right in the menu doesn't work.

It sounds like this issue was fixed in a commit and this ticket closed, then later a regression occurred.

Based on that belief, next time I have cycles, I'll attempt to learn how to re-apply the patch that makes the keybinding shown in the menu work when using VSCodeVim.

nathan-at-least avatar May 15 '20 13:05 nathan-at-least

@nathan-at-least you can just put "<C-k>": false into vim.handleKeys, and we'll ignore the keystroke so VSCode can handle it

J-Fields avatar May 19 '20 22:05 J-Fields

Seems to still be an issue on Friday's release:

Version: 1.49.3
Commit: 2af051012b66169dde0c4dfae3f5ef48f787ff69
Date: 2020-10-02T17:54:06.165Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0

wjn avatar Oct 04 '20 13:10 wjn

My 2c: if the reason why this was reverted that people rebind C-w to C-k, then surely they can reconfigure C-k to be captured.

I think that it makes sense to not clash with basic functinoality such as open directory chords that many VSCode users are used to.

serokellcao avatar Nov 09 '20 23:11 serokellcao

In case you are stuck in zen mode, because you toggled it in the menu, you can exit it with F11 ;)

rubo77 avatar Oct 12 '23 03:10 rubo77

I also had the same issue getting stuck in zen mode. Hitting escape twice or ctrl+k+z did not back out of zen mode. The F11 did the trick thanks!

Version: 1.92.2 (user setup) Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9 Date: 2024-08-14T17:29:30.058Z

VickyHowe avatar Sep 04 '24 00:09 VickyHowe