vscode: Visual Studio Code 常用快捷键

匿名 (未验证) 提交于 2019-12-02 23:05:13

vscode: Visual Studio Code 常用快捷键

官方快捷键说明:Key Bindings for Visual Studio Code

F1Ctrl+Shift+P: 打开命令面板。在打开的输入框内,可以输入任何命令,例如:

  • BackspaceCtrl+P
  • Ctrl+P>Ctrl+Shift+P

Ctrl+P

  • 直接输入文件名,跳转到文件
  • ?
  • !ErrorsWarningsCtrl+Shift+M
  • :Ctrl+G
  • @symbolCtrl+Shift+O
  • @symbolCtrl+Shift+O
  • #symbolCtrl+T
  1. Ctrl+Shift+N
  2. Ctrl+Shift+W
  3. 同时打开多个编辑器(查看多个文件)
  4. Ctrl+N
  5. Ctrl+Tab
  6. 3Ctrl+\CtrlExplorer
  7. 3Ctrl+1Ctrl+2Ctrl+3
  8. 3Ctrl+
  9. Ctrl+kLeftRight

格式调整

  1. Ctrl+[Ctrl+]
  2. Ctrl+CCtrl+V
  3. Shift+Alt+FCtrl+Shift+Pformat code
  4. Alt+UpAlt+Down
  5. Shift+Alt+UpShift+Alt+Down
  6. Ctrl+Enter
  7. Ctrl+Shift+Enter

光标相关

  1. Home
  2. End
  3. Ctrl+End
  4. Ctrl+Home
  5. F12
  6. Alt+F12
  7. Ctrl+Shift+]
  8. Shift+End
  9. Shift+Home
  10. Ctrl+Delete
  11. Shift+Alt+LeftShift+Alt+Right
  12. 多行编辑(列编辑):Alt+Shift+鼠标左键Ctrl+Alt+Down/Up
  13. Ctrl+Shift+L
  14. Ctrl+DCtrl+Shift+K
  15. Ctrl+U

重构代码

  1. Shift+F12
  2. Ctrl+F12
  3. F2,输入新的名字,回车,会发现所有的文件都修改了
  4. ErrorWarningF8
  5. diffexplorerSet file to compareCompare with file_name_you_chose

查找替换

  1. Ctrl+F
  2. Ctrl+H
  3. Ctrl+Shift+F
  1. 全屏:F11
  2. zoomIn/zoomOut:Ctrl +/-
  3. 侧边栏显/隐:Ctrl+B
  4. Ctrl+Shift+E
  5. Ctrl+Shift+F
  6. Ctrl+Shift+G
  7. Ctrl+Shift+D
  8. Ctrl+Shift+U
  • 自动保存:File -> AutoSaveCtrl+Shift+Pauto

打开默认键盘快捷方式设置:
File -> Preferences -> Keyboard Shortcuts,或者:Alt+F -> p -> k

keybindings.json

 // Place your key bindings in this file to overwrite the defaults [     // ctrl+space 被切换输入法快捷键占用     {         "key": "ctrl+alt+space",         "command": "editor.action.triggerSuggest",         "when": "editorTextFocus"     },     // ctrl+d 删除一行     {         "key": "ctrl+d",         "command": "editor.action.deleteLines",         "when": "editorTextFocus"     },     // 与删除一行的快捷键互换     {         "key": "ctrl+shift+k",         "command": "editor.action.addSelectionToNextFindMatch",         "when": "editorFocus"     },     // ctrl+shift+/多行注释     {         "key":"ctrl+shift+/",         "command": "editor.action.blockComment",         "when": "editorTextFocus"     },     // 定制与 sublime 相同的大小写转换快捷键,需安装 TextTransform 插件     {         "key": "ctrl+k ctrl+u",         "command": "uppercase",         "when": "editorTextFocus"     },     {         "key": "ctrl+k ctrl+l",         "command": "lowercase",         "when": "editorTextFocus"     } ] 
  • PostCSS Sorting
  • stylelint
  • stylefmt
  • ESLint
  • javascript standard format
  • beautify
  • Babel ES6/ES7
  • Debugger for Chrome
  • Add jsdoc comments
  • javascript(ES6) code snippets
  • vue
  • weex
  • Reactjs code snippets
  • React Native Tools
  • Npm Intellisense
  • Instant Markdown
  • Markdown Shortcuts
  • TextTransform

vscode 自定义配置参考:

 {     "editor.fontSize": 18,     "files.associations": {         "*.es": "javascript",         "*.es6": "javascript"     },     // 控制编辑器是否应呈现空白字符     "editor.renderWhitespace": true,     // 启用后,将在保存文件时剪裁尾随空格。     "files.trimTrailingWhitespace": true,     // File extensions that can be beautified as javascript or JSON.     "beautify.JSfiles": [         "",         "es",         "es6",         "js",         "json",         "jsbeautifyrc",         "jshintrc"     ] }
文章来源: https://blog.csdn.net/u012282382/article/details/86635957
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!