VSCode 사용 중에 키보드에서 손을 떼지 않고 terminal, editor 사이를 왔다갔다 할 때 유용한 정보입니다.
VSCode 에서 F1키를 누르고 Keyboard Shortcuts를 검색합니다.
화살표로 된 (JSON) 파일을 열고 아래와 같은 JSON 형식의 값을 저장합니다.
세번째 메뉴(단축기 Ctrl+K)는 UI로 제공해줍니다.
[
{
"key": "ctrl+oem_7",
"when": "terminalFocus",
"command": "workbench.action.focusActiveEditorGroup"
},
{
"key": "ctrl+oem_7",
"when": "editorFocus",
"command": "terminal.focus"
}
]
이제 Control + ' 키를 사용해 editor에 포커스가 돼있었다면 terminal로, terminal에 포커스가 돼있었다면 editor로 바로 이동할 수 있습니다.
"key" 의 밸류값을 바꿔서 원하는 키로 바꿀 수도 있습니다.
참고
본인이 사용하는 단축키입니다.
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+oem_7",
"when": "terminalFocus",
"command": "workbench.action.focusActiveEditorGroup"
},
{
"key": "ctrl+oem_7",
"when": "editorFocus",
"command": "terminal.focus"
},
{
"key": "ctrl+shift+oem_6",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
"key": "ctrl+pagedown",
"command": "-workbench.action.terminal.focusNext",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
"key": "ctrl+shift+oem_4",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
"key": "ctrl+pageup",
"command": "-workbench.action.terminal.focusPrevious",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
}
]