[tip] VSCode terminal, editor 사이 토글하기

Seunghyun Moon·2023년 12월 19일
0

tip

목록 보기
6/6

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" 의 밸류값을 바꿔서 원하는 키로 바꿀 수도 있습니다.

참고
https://velog.io/@ash/VSCode%EC%97%90%EC%84%9C-editor-terminal%EA%B0%84-%EC%BB%A4%EC%84%9C-%EC%9D%B4%EB%8F%99-%EB%8B%A8%EC%B6%95%ED%82%A4-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0

참고
본인이 사용하는 단축키입니다.

// 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"
    }
]
profile
I live fullest

0개의 댓글