-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
feat(keybindings): global window resize/split #1257
feat(keybindings): global window resize/split #1257
Conversation
Aside from the localisation issues, is this ready for merge? |
@theol0403 I'd like to know if there is an easy fix for the location issues. I think the worse case is that it will only work partially, depending on your local. If you decide to merge it, we should open an issue and keep track of it. It shouldn't break anything if you merge it now. |
What if you tried |
@theol0403 wdym? |
Sorry, I know nothing about your locale, but I thought maybe binding the physical keys would fix the problem. That assumes I see the problem is the opposite. |
@theol0403 This is my layout: To make it work properly, I have to do: {
"key": "ctrl+w =",
"command": "workbench.action.evenEditorWidths",
"when": "!editorTextFocus"
},
{
"key": "ctrl+w shift+-",
"command": "workbench.action.toggleEditorWidths",
"when": "!editorTextFocus"
},
{
"key": "ctrl+w [Backquote]",
"command": "workbench.action.decreaseViewWidth",
"when": "!editorTextFocus"
},
{
"key": "ctrl+w shift+[Backquote]",
"command": "workbench.action.increaseViewWidth",
"when": "!editorTextFocus"
},
{
"key": "ctrl+w +",
"command": "workbench.action.increaseViewHeight",
"when": "!editorTextFocus"
},
{
"key": "ctrl+w -",
"command": "workbench.action.decreaseViewHeight",
"when": "!editorTextFocus"
},
{
"key": "ctrl+w s",
"command": "workbench.action.splitEditorDown",
"when": "!editorTextFocus"
},
{
"key": "ctrl+w v",
"command": "workbench.action.splitEditorRight",
"when": "!editorTextFocus"
}, Hopefully you can see where this is going. VSCode wants physical keys (which are named by the US keyboard in If I map VSCode needs to allow to map a logical key. Unless they offer a flag or something like that, we cannot map Vim commands that involve special characters properly for all keyboard layouts. Interestingly, this behavior doesn't happen for Also, please upvote microsoft/vscode#186961, because we need to show them that we need this functionality. |
Looks good! Very convenient shortcuts |
I suppose nothing can be done other than to merge the existing ability. |
@xiyaowong can you rebase? |
Wait a minute |
62e746f
to
0659130
Compare
Maybe change the script name |
Sure, or something related to vscode bindings like vscode-integration. |
Idea is to have global window split and resize keybindings outside of Neovim. Unfortunately, this doesn't work as it should be.
VSCode keybindings are locale aware. So instead of mapping the character, it requires to map the physical key, which is not what we want. Vim isn't aware of physical keys, so it reacts on characters which will result in different key strokes depending on the keyboard layout.
I'm using a German macOS keyboard layout (ISO whatever), VSCode won't let me map most of the keybindings to a locale-independent keymap:
Interestingly, the behavior we strive for seems to work for
=
:So it seems to be possible, it's just not feature complete(?).