6

By default, when move cursor by word, via ctrl + left or right, it doesn't respect camel case.

Both Eclipse / Idea can respect camel case when use the shortcut.

Is there anyway to make vscode respect the camel case?

BTW, there is a similar question about visual studio (here), but not about vscode.

2
  • 1
    What do you mean by that? What is it doing that you don't want it to do? Commented Oct 13, 2024 at 4:01
  • @TimRoberts I mean move cursor to jump by words, I've updated the question a bit. Commented Oct 13, 2024 at 4:10

1 Answer 1

14

(I figured out the solution, so I want to create both the question & answer, to share with others, since there is no existing question to add an answer to).

In vscode:

  • cursorWord shortcuts, means jump without respect to camel case.
    By default, ctrl + left/right is assigned to these shortcuts.
  • cursorWordPart shortcuts, means jump with respect to camel case.
    By default, they have no shortcuts assigned.

Thus the solution is:

  • First, add shortcut that respect camel case:

    • cursorWordPartLeft set to: ctrl + left
    • cursorWordPartRight set to: ctrl + right
    • cursorWordPartLeftSelect set to: ctrl + shift + left
    • cursorWordPartRightSelect set to: ctrl + shift + right
  • Then, remove shortcut that don't respect camel case:

    • cursorWordLeft
    • cursorWordRight
    • cursorWordLeftSelect
    • cursorWordRightSelect

Tips:

  • Shortcuts with Select means jump & select.
  • use ctrl + k, ctrl +s to open the shortcut config page.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.