[VSCode] 한 키에 여러 단축키를 설정하는 방법(How to set multiple commands at a key).

Sinaenjuni·2024년 7월 24일
0

Solved

목록 보기
3/3

VSCode를 사용하다 보면 하나의 키에 여러 명령을 순차적으로 수행하고 싶은 경우가 있다. 이럴때 사용하는 방법을 기록한다.

다음 예시는 현재 셀을 실행하는 jupyter.runcurrentcell 명령과 다음 셀로 포커스를 옮기는 명령인 jupyter.gotoNextCellInFile을 순차적으로 실행하도록 하여, 현재 셀을 실행하고 자동으로 다음 셀로 넘어가는 기능을 구현한 것이다.

{
  "key": "ctrl+shift+enter",
  "command": "runCommands",
  "args": {
    "commands": [
      "jupyter.runcurrentcell",
      "jupyter.gotoNextCellInFile"
    ]
  },
  "when": "editorTextFocus && isWorkspaceTrusted && jupyter.hascodecells && !editorHasSelection && !jupyter.havenativecells && !notebookEditorFocused"
},

References

  1. https://code.visualstudio.com/docs/getstarted/keybindings

0개의 댓글