본문 바로가기
프로그래밍/Basic Knowlege

Visual Studio Code 단축키 생성 Console.log('')

by Damon11 2023. 2. 3.

Console.log 입력할 때 마다 답답해서, 단축키 생성방법이 있나 검색해봤음

바로 발견!@!

 

위 방법을 사용하면 콘솔로그 뿐 아니라 자주사용되는 모든 문구들을 추가할 수 있다.

 

  1. File > Preferences > Keyboard Shortcuts
  2. 오른쪽 위에 아이콘 클릭 (아래 사진 참조)
  3. keybindings.json 파일이 열리면 대괄호 안에 아래 내용 추가
  {
    "key": "ctrl+shift+l",
    "command": "editor.action.insertSnippet",
    "when": "editorTextFocus",
    "args": {
      "snippet": "console.log('${TM_SELECTED_TEXT}$1')$2;"
    }
  }

 

 

 

 

 

 

출처:https://stackoverflow.com/questions/40177331/what-is-the-shortcut-in-visual-studio-code-for-console-log

댓글