728x90
반응형

Visual Studio Code (VSCode)는 v1.25부터 CamelCase 내비게이션 기능을 기본으로 제공합니다. 이 기능을 사용하면 CamelCase로 작성된 단어의 각 부분 단위로 커서를 이동할 수 있습니다. 예를 들어, myVariableName에서 my, Variable, Name 부분으로 커서를 쉽게 이동할 수 있습니다.

이 문서에서는 VSCode에서 CamelCase 단위로 커서를 이동하도록 키 바인딩을 설정하는 방법을 설명합니다.

설정 방법

1. 키 바인딩 파일 열기

VSCode에서 명령 팔레트(Cmd+Shift+P / Ctrl+Shift+P)를 열고
Preferences: Open Keyboard Shortcuts (JSON)을 검색하여 선택합니다.

2. 키 바인딩 추가

keybindings.json 파일이 열리면, 아래 코드를 추가합니다:

[
  {
    "key": "alt+right",
    "command": "cursorWordPartRight",
    "when": "editorTextFocus"
  },
  {
    "key": "alt+left",
    "command": "cursorWordPartLeft",
    "when": "editorTextFocus"
  },
  {
    "key": "alt+shift+right",
    "command": "cursorWordPartRightSelect",
    "when": "editorTextFocus"
  },
  {
    "key": "alt+shift+left",
    "command": "cursorWordPartLeftSelect",
    "when": "editorTextFocus"
  }
]

위의 설정은 Alt 키(또는 Option 키)와 방향키를 사용하여 CamelCase 단위로 커서를 이동할 수 있도록 합니다.

반응형