Vim icon indicating copy to clipboard operation
Vim copied to clipboard

[Why?] Ctrl + Shift + Left Arrow (Insert mode) => Enters visual mode

Open OranBar opened this issue 5 years ago • 2 comments

Hello,

I would like to ask for some help. I'm trying to learn Vi, and using this extension, there's something I do not understand.

In my settings, I have disabled "Use Ctrl Keys:".

When, in normal mode, If press Ctrl + Shift + Right Arrow, the word to the right gets selected, and I remain in insert mode. This is as expected.

But, When in normal mode, If press Ctrl + Shift + Left Arrow, the word to the left gets selected, and I enter visual mode. This confuses me. I do not understand why, and would like for this hotkey combination to behave like the other one, not kicking me out of insert mode and into visual.

How would I go about fixing this behaviour? Why is it happening?

OranBar avatar Dec 12 '20 15:12 OranBar

When, in normal mode, If press Ctrl + Shift + Right Arrow, the word to the right gets selected, and I remain in insert mode. This is as expected.

Do you mean "When in insert mode"?! From what I'm understanding you are in insert mode and pressing Ctrl+Shift+LeftArrow selects the word to the left and you get into Visual mode. But this doesn't happen if you press Ctrl+Shift+RightArrow.

Please give us more information, like your system OS version, what is the vscode version and what is the version of the extension you are using.

I can't reproduce that behavior on Windows 10. It appears to me that you might have a keybinding for Ctrl+Shift+LeftArrow or some extension that has bound that key combination to something else. Check your "Keyboard Shortcuts" to see if you have some keybinding set to "ctrl+shift+left"?

berknam avatar Dec 12 '20 22:12 berknam

When, in normal mode [...] Do you mean "When in insert mode"?!

Yeah, typo. I meant to say 'When in insert mode". For the record, the same behaviour happens when in normal mode. It will switch to visual mode only when I use the combination to go left.

From what I'm understanding you are in insert mode and pressing Ctrl+Shift+LeftArrow selects the word to the left and you get into Visual mode. But this doesn't happen if you press Ctrl+Shift+RightArrow.

Exaclty!

Please give us more information, like your system OS version, what is the vscode version and what is the version of the extension you are using.

Windows 10 Pro 64-bit VS-Code v1.52.0 Vim (extension for code) v1.18.5

I can't reproduce that behavior on Windows 10. It appears to me that you might have a keybinding for Ctrl+Shift+LeftArrow or some extension that has bound that key combination to something else. Check your "Keyboard Shortcuts" to see if you have some keybinding set to "ctrl+shift+left"?

Now that you mention it, the issue does appear to be linked to keybinding settings.

Apparently, those two keys are binded completely differently, even tho they show similar behaviour. I'm unsure how this happened. Maybe one of the many extensions I tried before trying Vi.

Code_2020-12-13_21-55-49 Code_2020-12-13_21-56-06

I have now successfully solved the problem by unbinding that weird "cursorWordLeftSelect", and mirroring the configuration of the right key for the left key.

Thanks for taking your time to help me through. I appreciate it. I'll leave my solution here, it case it happens to anyone else

OranBar avatar Dec 13 '20 21:12 OranBar