vscode: Visual Studio Code 常用快捷键

匿名 (未验证) 提交于 2019-12-02 23:05:13
https://lzw.me/a/vscode-visual-studio-code-shortcut.html

Ctrl+Shift+P

  • Ctrl+P
  • Ctrl+PCtrl+Shift+P
  • Ctrl+P
    -直接输入文件名,跳转到文件

    • ? 列出当前可执行的动作
    • Ctrl+Shift+M
    • Ctrl+G
    • Ctrl+Shift+O
    • Ctrl+Shift+O
    • Ctrl+T
  • Ctrl+Shift+N
  • Ctrl+Shift+W
  • 同时打开多个编辑器(查看多个文件)
  • Ctrl+N
  • Ctrl+Tab
  • 切出一个新的编辑器(最多 3 个) Ctrl+\,也可以按住 Ctrl 鼠标点击 Explorer 里的文件名
  • Ctrl+1Ctrl+2Ctrl+3
  • 3 个编辑器之间循环切换 Ctrl+
  • Ctrl+k然后按 Left或 Right
  • Ctrl+[Ctrl+]
  • Ctrl+CCtrl+V
  • Shift+Alt+FCtrl+Shift+Pformat code
  • Alt+UpAlt+Down
  • Shift+Alt+UpShift+Alt+Down
  • Ctrl+Enter
  • Ctrl+Shift+Enter
  • 移动到行首: Home
  • 移动到行尾: End
  • Ctrl+End
  • Ctrl+Home
  • 移动到定义处: F12
  • Alt+F12
  • Ctrl+Shift+]
  • Shift+End
  • Shift+Home
  • Ctrl+Delete
  • Shift+Alt+LeftShift+Alt+Right
  • 多行编辑(列编辑):Alt+Shift+鼠标左键Ctrl+Alt+Down/Up
  • Ctrl+Shift+L
  • Ctrl+DCtrl+Shift+K
  • Ctrl+U
  • Ctrl + Shift + L键,即可快速选中当前文件中所有匹配的词,并在每一个词后面有一个编辑光标,可批量同步编辑
  • Shift+F12
  • Ctrl+F12
  • F2,输入新名字,回车,则所有该方法的引用也都同步更新了
  • F8
  • Set file toCompare with file_name_you_chose
  • Ctrl+F
  • Ctrl+H
  • Ctrl+Shift+F
  • 全屏:F11
  • zoomIn/zoomOut:Ctrl +/-
  • Ctrl+B
  • Ctrl+Shift+E
  • Ctrl+Shift+F
  • Ctrl+Shift+G
  • Ctrl+Shift+D
  • Ctrl+Shift+U
  • 自动保存:File -> AutoSaveCtrl+Shift+Pauto

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

keybindings.json

01 // Place your key bindings in this file to overwrite the defaults
02 [
03 // ctrl+space 被切换输入法快捷键占用
04 {
05 "key""ctrl+alt+space",
06 "command""editor.action.triggerSuggest",
07 "when""editorTextFocus"
08 },
09 // ctrl+d 删除一行
10 {
11 "key""ctrl+d",
12 "command""editor.action.deleteLines",
13 "when""editorTextFocus"
14 },
15 // 与删除一行的快捷键互换
16 {
17 "key""ctrl+shift+k",
18 "command""editor.action.addSelectionToNextFindMatch",
19 "when""editorFocus"
20 },
21 // ctrl+shift+/多行注释
22 {
23 "key":"ctrl+shift+/",
24 "command""editor.action.blockComment",
25 "when""editorTextFocus"
26 },
27 // 定制与 sublime 相同的大小写转换快捷键
28 editor.action.transformToLowercase
29 editor.action.transformToUppercase
30 {
31 "key""ctrl+k ctrl+u",
32 "command""editor.action.transformToUppercase"
33 "when""editorTextFocus"
34 },
35 {
36 "key""ctrl+k ctrl+l",
37 "command""editor.action.transformToLowercase"
38 "when""editorTextFocus"
39 }
40 ]

前端开发必备插件

  • 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 自定义配置参考:

01 {
02 "editor.fontSize":16,
03 "editor.tabSize":2,
04 "editor.fontLigatures"true,
05 // 使用等宽字体 Fira Code
06 "editor.fontFamily""Fira Code, 'Noto Sans CJK SC Medium', Consolas, 'Courier New', monospace",
07 // 关闭右侧的 minimap
08 "editor.minimap.enabled"false,
09 "editor.minimap.renderCharacters"false,
10 "files.associations": {
11 "*.es""javascript",
12 "*.es6""javascript"
13 },
14 // 控制编辑器是否应呈现空白字符
15 "editor.renderWhitespace""all",
16 // 启用后,将在保存文件时剪裁尾随空格。
17 "files.trimTrailingWhitespace"true,
18 // File extensions that can be beautified as javascript or JSON.
19 "beautify.JSfiles": [
20 "",
21 "es",
22 "es6",
23 "js",
24 "json",
25 "jsbeautifyrc",
26 "jshintrc"
27 ],
28 // 关闭 git 自动刷新、fetch、add 操作
29 "git.enableSmartCommit"false,
30 "git.enabled"true,
31 "git.autorefresh"false,
32 "git.autofetch"false,
33 }
    • 官方快捷键大全:https://code.visualstudio.com/docs/customization/keybindin
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!