Skip to content
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

Shortcuts ctrl+left and ctrl+right don't move cursor to expected positions #34457

Closed
grokky1 opened this issue Sep 15, 2017 · 2 comments
Closed
Assignees
Labels
editor-core Editor basic functionality *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@grokky1
Copy link

grokky1 commented Sep 15, 2017

  • VSCode Version: 1.16.0
  • OS Version: Win10 x64
  1. I want to move cursor between words using ctrl+left and ctrl+right
  2. In most editors, and in Visual Studio too, cursor would move to the left or right and position itself before the previous/next word's first character.
  3. But in VSCode it does not work that way - it moves to first/last character of the same word.

Very frustrating as it's not the same as in VS or the 99% of IDEs and editors out there. Even here in GitHub it works that way, try it for yourself.

@vscodebot vscodebot bot added editor editor-core Editor basic functionality labels Sep 15, 2017
@alexdima
Copy link
Member

To control this behaviour and get VS-style Ctrl+Right, please edit your keybindings.json and add:

{ "key":"ctrl+right",       "command":"cursorWordStartRight",       "when":"editorTextFocus" }
{ "key":"ctrl+shift+right", "command":"cursorWordStartRightSelect", "when":"editorTextFocus" }

This will overwrite the defaults:

{ "key":"ctrl+right",       "command":"cursorWordEndRight",       "when":"editorTextFocus" }
{ "key":"ctrl+shift+right", "command":"cursorWordEndRightSelect", "when":"editorTextFocus" }

You can also use a keymap extension like the Visual Studio keymap extension.

@alexdima alexdima added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Sep 22, 2017
@grokky1
Copy link
Author

grokky1 commented Sep 22, 2017

@alexandrudima Awesome that works... thanks! 😄

For anyone else reading this, the same can be done for ctrl+left and ctrl+shift+left!


1 issue down, 5000 to go... LOL! Thanks again 😆

@grokky1 grokky1 closed this as completed Sep 22, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-core Editor basic functionality *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants