不太喜欢敲几个字母再等提示出来,太慢了,就应该按键盘直接插入
先在 snippets 中新建配置
cmd + shift + p
-> Configure User Snippets
-> New Global Snippets File
1 2 3 4 5 6 7 8 9 10 11
| { "console.log": { "scope": "javascript,typescript,javascriptreact", "prefix": "log", "body": [ "console.log('$1', $1);" ], "description": "Log output to console" } }
|
然后在 Keyboard Shortcuts 中
Preference
-> Keyboard Shortcuts
-> JSON file
or cmd + k cmd + s
1 2 3 4 5
| { "key": "shift+cmd+l", "command": "editor.action.insertSnippet", "args": { "name": "console.log" } }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| { "workbench.colorTheme": "Dracula", "window.zoomLevel": 1, "workbench.iconTheme": "material-icon-theme", "editor.tabSize": 2, "emmet.triggerExpansionOnTab": true, "emmet.includeLanguages": { "javascript": "javascriptreact" }, "eslint.validate": [ "javascript", "javascriptreact", { "language": "html", "autoFix": true }, { "language": "vue", "autoFix": true } ], "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "terminal.external.osxExec": "iTerm.app", "emmet.extensionsPath": "" }
|