-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Key mapping does not support ctrl key #1452
Comments
Not sure if I should expect the plugin to manage custom key bindings for VScode, other than maybe providing a vim-like configuration. In the meantime, I used VSCode's user-defined keymappings to accomplish mapping Code -> Preferences -> Keyboard Shortcuts (or ⌘K ⌘S) [
{
"key": "ctrl+alt+h",
"command": "workbench.action.focusPreviousGroup",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+l",
"command": "workbench.action.focusNextGroup",
"when": "editorTextFocus"
},
{
"key": "ctrl+h",
"command": "workbench.action.previousEditor",
"when": "editorTextFocus"
},
{
"key": "ctrl+l",
"command": "workbench.action.nextEditor",
"when": "editorTextFocus"
}
] |
The problem is we dont bind to ctrl+l so our extension does not know it exists, ctrl+h we only use in insert mode...so we can't remap these from inside the plugin currently... |
Just as a side note, c-h works for me in normal mode (as a backspace key) |
@dbernheisel thanks, I was able to get what I wanted using those commands, [
{
"key": "ctrl+h",
"command": "workbench.action.focusPreviousGroup",
"when": "editorTextFocus"
},
{
"key": "ctrl+l",
"command": "workbench.action.focusNextGroup",
"when": "editorTextFocus"
},
{
"key": "cmd+shift+[",
"command": "workbench.action.previousEditor",
"when": "editorTextFocus"
},
{
"key": "cmd+shift+]",
"command": "workbench.action.nextEditor",
"when": "editorTextFocus"
}
] Is what I've changed to. Unfortunately, I'm not familiar enough with VSCode to know the nomenclature of, for example, window vs buffer and so on like we have in vim. I actually wasn't able to figure out how to make those key mappings the VSCode way so I tried to do it by making a vim mapping. I'm probably just misunderstanding the purpose of the |
It's possible to cover this issue by #1543 |
I have a similar issue attempting to bind |
@barberousse What's the issue with simply using normally? We don't bind it in normal mode at all. |
@Chillee Are you sure? Ctrl + p appears to be bound to the canonical vi command of "Move one line up". To be clear, I'm on OS X as well, so quick open should fire on Cmd + P instead of Ctrl + p. At any rate, the following fails to rebind as expected, the behavior persists in "Move one line up":
|
That's interesting. I don't think we've really implemented that. We only bind You could try this too.
Although, I don't use a mac, so I'm not sure how most of that stuff works with regards to keybindings. |
Setting the boolean there did not change behavior, but it does confirm to my understanding that the extension truly isn't responsible for the unexpected behavior as well. |
@barberousse are you on OS X? This emacs-like movement is baked into most text fields on OS X (try it even on the github comments input field). |
@hk0i I am, must be it |
Reporting in, I cannot rebind Anyway, sorry for the complaint. Great work! |
@iantanwx Does this not work for you?
|
C-p should be opening quick open already... we don't rebind it |
FYI, I was able to solve my problem by placing that into my |
Hi
|
For the original question of mapping
I think this works better than mapping to the command |
I'm having the issue with binding
|
Actually it does work if I just set the keybindings directly in
|
I had a similar issue remapping emacs-like text motion in insert mode (trying to get ctrl-{a,e,p,n,d,h,f,b} to work in insert mode like other mac text boxes). Either the vscodevim keymappings would have preference over my vim.*KeyBindings or they'd be disabled if I used handleKeys to exclude them.
I also added the ctrl-p similar to @eysi09, but gated to only be in non-insert mode:
I also added C-{h,l,j,k} to do vim navigation (the original question here) similar to @jpotterm but filtering to only non-insert mode (so I can still have delete backward & join line & kill line in insert mode):
I bet it'd be good to call some of this out in the readme (namely that most C-* bindings that are already handled by vscodevim aren't user-configurable via the vim.KeyBindings user setting, but only by keybindings.json). It took me a bit to find this issue |
We bind to a couple of
For keycombos that involve CTRL, the full list is in our package.json, for others we have a bug tracking this here #757. |
Please thumbs-up 👍 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.
What did you do?
Attempted to map Ctrl +h to Ctrl-w h.
In
settings.json
:Saved config, then tried Ctrl + h
What did you expect to happen?
Expected to map Ctrl +h to Ctrl-w h
What happened instead?
Character under cursor was deleted. (Escape sequence Ctrl+h ??)
Technical details:
The text was updated successfully, but these errors were encountered: