Search code examples
visual-studio-codecursorhotkeysvscode-keybinding

How can I prevent Visual Studio Code cursor skipping symbols when using CTRL + Left/Right Arrow?


From the position in my screenshot, if I do ctrl+left, the cursor will skip the . symbol. Same for ={, it will skip = symbol. How can I prevent this behavior in VS Code, and not skip that? In JetBrains products, it works like that, and it's really bothers me in VS Code.

cursor position example


Solution

  • I believe you want the cursorWordStartLeft and cursorWordStartRight bindings to be bound. You can set them to whatever you want, but you probably want them to be the same as the cursorWordLeft and cursorWordRight. Of course you also probably want to unbind the other controls too. You also probably want the same when condition which is textInputFocus && !accessibilityModeEnabled:

    cursor word start left and right bindings to enable

    After setting this bindings, the cursor behaves more like how you want:

    gif showing changed cursor beahvior