安装

1
brew install visual-studio-code

配置

进入配置

  1. 文件-> 首选项 ->配置
  2. 点击右上边的文件图标,进入打开设置(打开配置文件C:\Users\ \AppData\Roaming\Code\User\settings.json)

修改插件安装目录

1
2
mklink /D "C:\Users\<username>\.vscode\extensions" "<newpath>"

shortkeys

说明

本文以windows为例。

basic

  1. F2: rename
  2. ctrl + p: open command options
  3. ` ctrl+ `` : open terminal
  4. ctrl + Shift + F: search
  5. ctrl+ K, then Z: zen mode
  6. esc esc: from zen mode to the normal editor view
  7. ctrl+B: Toggle sidebar
  1. F8: Navigate errors and warnings

File

  1. ctrl+f4: close file
  2. ctrl+W: tab through open files

editor

  1. ctrl + \: split editor
  2. ctrl + Shift + T: open a Closed Editor
  3. ctrl + T: open a file
  4. Ctrl + Home: go to the beginning of file
  5. Ctrl + End: go to the end of file
  6. CTRL + K + W: Close all open editor tabs
  7. SHIFT+ALT+F: Format document

cursor

  1. Ctrl+Shift+L: Create cursor on all occurrences
  2. Ctrl+Shift+Arrow key: Add the cursor
  3. alt+ mouse click at the position: Insertadditional cursors
  4. ctrl+ U: remove additional cursors

code

  1. ctrl + t: search current workspace sysmols
  2. ctrl + Shift + o: search current file sysmols
  3. ctrl + Alt + Up arrow/Down arrow.: . Add Multiple Cursors
  4. Shift + Alt + F: formart code
  5. Ctrl + Backspace: Delete Previous Word
  6. Ctrl + Shift + Right Arrow: select texts word by word from right to left
  7. Ctrl + Shift + Left Arrow: select texts word by word from left to right
  8. Ctrl + Shift + [: To fold the innermost uncollapsed region at the cursor
  9. Ctrl + Shift + ]: To unfold the innermost uncollapsed region at the cursor
  10. Shift + Alt:Column (Box) Selection
  11. Ctrl+K Ctrl+0 : fold all sections
  12. Ctrl+K Ctrl+J: unfold all sections
  13. CTRL + SHIFT + L: Add cursors to all matching selections
  14. CTRL + D: Add cursor to next matching selection
  15. Shift + Alt + Up/Down: Copy Line Up/Down
  16. ctrl+ shift + \: Find a matching bracket
  17. shift + alt + → or ←: move and expand the selection
  18. shift+ alt+ A: add block comment
  19. ctrl+ /: add comment

line

  1. alt +J: join lines
  2. ctrl +g: jump to line
  3. Alt + Up arrow/Down arrow: move line
  4. Ctrl + Shift + D: Duplicate Line
  5. Shift + Alt + Up/Down: Copy Line Up/Down
  6. ctrl + x: delete current line
  7. Ctrl+Shift+K: Delete an entire line
  8. CTRL + L: Select current line
  9. CTRL + Enter: insert line below
  10. CTRL + Enter + Shift: insert line above

extensions

  1. Prettier - Code formatter

  2. ESLint

  3. Color Highlight

  4. Bracket Pair Colorizer 2

  5. GitLens

  6. Live Share

  7. VS Code Remote Development

  8. Peacock

欢迎关注

欢迎关注微信公众帐号:沉风网事(savewind)

沉风网事