Visual studio code shortcut key in Windows

Time:2019-11-8

Visual studio code is an excellent editor, very suitable for writing ts and react. Recently, I was learning angularjs 2 and started to use vscode. I specially arranged and translated the shortcut keys on the official website. Because I am used to the shortcut key of sublime, it is not suitable to change to vscode, especially the use of Emmet.

Software name:
Visual studio code 64 bit v1.28.1 official latest installation
Software size:
42.0MB
Updated:
2018-10-18
currency
Ctrl+Shift+P, F1 Open command panel
Ctrl+P Quick open file
Ctrl+Shift+N Open a new window / instance
Ctrl+Shift+W Close window / instance
Basic editors
Ctrl+X Cut current line
Ctrl+C Copy current line
Alt+ ↑ / ↓ Move current row up / down
Shift+Alt + ↓ / ↑ Copy current row up / down
Ctrl+Shift+K Delete current row
Ctrl+Enter Insert below current line
Ctrl+Shift+Enter Insert above current line
Ctrl+Shift+\ Jump to matching bracket
Ctrl+] / [ Indent / UN indent
Home Turn to the head
End Go to the end of the line
Ctrl+Home Transfer to page header
Ctrl+End Go to page end
Ctrl+↑ / ↓ Scroll up / down
Alt+PgUp / PgDown Page up / down
Ctrl+Shift+[ Collapse current code block
Ctrl+Shift+] Expand current code block
Ctrl+K Ctrl+[ Collapse all child blocks
Ctrl+K Ctrl+] Expand all child blocks
Ctrl+K Ctrl+0 Collapse all code blocks
Ctrl+K Ctrl+J Expand all code blocks
Ctrl+K Ctrl+C Add line comment
Ctrl+K Ctrl+U Delete line comment
Ctrl+/ Add / remove line comments
Shift+Alt+A Add / remove block notes
Alt+Z Automatic line feed
Navigation
Ctrl+T Show all symbols
Ctrl+G Jump to row
Ctrl+P Jump to file
Ctrl+Shift+O Jump to symbol
Ctrl+Shift+M Show question panel
F8 Jump to the next question or warning
Shift+F8 Jump to previous question or warning
Ctrl+Shift+Tab Show editor file history
Alt+ ← / → View files backward / forward
Ctrl+M Turn tab on / off to move focus
Search and replace
Ctrl+F lookup
Ctrl+H replace
F3 / Shift+F3 Find next / previous
Alt+Enter Select all matches
Ctrl+D  Select next match
Ctrl+K Ctrl+D  Skip current selection
Alt+C / R / W  Toggle case sensitive / regular expression / whole word
Multi cursor and selection
 Alt+Click Insert cursor
 Ctrl+Alt+ ↑ / ↓ Insert cursor up / down
 Ctrl+U Undo previous cursor
 Shift+Alt+I Inserts a cursor at the end of the selected row
 Ctrl+I Select current row
 Ctrl+Shift+L Select all matches for the currently selected item
 Ctrl+F2 Select all matches for the current word
 Shift+Alt+→ extend selection
 Shift+Alt+← Narrowing selection
 Shift+Alt + (drag mouse) Column (box) selection
 Ctrl+Shift+Alt + (arrow key) Column (box) selection
 Ctrl+Shift+Alt +PgUp/PgDown Up / down column (box) selection
Rich language editor
 Ctrl+Space Open suggestion
 Ctrl+Shift+Space Open parameter prompt
 Tab Emmet expansion abbreviation
 Shift+Alt+F Format Document
 Ctrl+K Ctrl+F Format selection area
 F12 Jump to definition
 Alt+F12 Open window display definition
 Ctrl+K F12 Open sidebar display definition
 Ctrl+. Quick solution
 Shift+F12 Display reference
 F2 Rename symbol
 Ctrl+Shift+ . / , Replace with next / previous value
 Ctrl+K Ctrl+X Remove space at end of line
 Ctrl+K M Change text language
Editorial management
 Ctrl+F4, Ctrl+W Close edited file
 Ctrl+K F Close folder
 Ctrl+\ Split editor window
 Ctrl+ 1 / 2 / 3 Switch to the first, second, or third window
 Ctrl+K Ctrl+ ←/→ Switch to previous / next window
 Ctrl+Shift+PgUp /PgDown Move edited files left / right
 Ctrl+K ← / → Move edit window left / right

Visual studio code standing shortcut key

Official shortcut key collection: https://code.visualstudio.com/docs/customization/keybindings

Visual studio code is a powerful editor, which can be used to replace other text file editing tools. It can also be used for development and support various languages. Compared with other ides, lightweight, fully configurable and integrated Git is very suitable for front-end development So I’ve looked closely at documents that might be used as a major tool in the future.

Main command box

The most important function isF1orCtrl+Shift+POpen the command panel. In this command box, you can execute any command of vscode, or even close the editor.
ClickBackspaceWill enterCtrl+PIn mode
stayCtrl+PLower input>You can go backCtrl+Shift+PPattern.
stayCtrl+PIt’s OK under the window

  • Enter file name directly, jump to file
  • ?List currently available actions
  • !Display errors or warnings, or ` Ctrl + Shift + M
  • :Jump to the number of lines, orCtrl+GDirect access
  • @Jump to symbol (search variable or function), orCtrl+Shift+ODirect access
  • @:Jump to symbol according to the classification, find the attribute or function, orCtrl+Shift+OPost input:Get into
  • #Find symbol by name, orCtrl+T

Common shortcut keys

Editor and window management

Open multiple windows at the same time (view multiple items)

  • Open a new window:Ctrl+Shift+N
  • Close window:Ctrl+Shift+W

Open multiple editors at the same time (view multiple files)

  • new fileCtrl+N
  • Switch between filesCtrl+Tab
  • Cut out a new editor (up to 3)Ctrl+\You can also hold down the CTRL mouse and click on the file name in Explorer
  • Shortcut keys of three editors in the middle left and rightCtrl+1Ctrl+2Ctrl+3
  • Loop between 3 editors Ctrl+`
  • Editor changes position,Ctrl+kThen pressLeftorRight

Code editing

Format adjustment

  • Code line indentCtrl+[Ctrl+]
  • Ctrl+CCtrl+VIf unchecked, copies or cuts an entire row by default
  • Code format:Shift+Alt+FOrCtrl+Shift+PPost inputformat code
  • Move up and down one line:Alt+UporAlt+Down
  • Copy one line up and down:Shift+Alt+UporShift+Alt+Down
  • Insert a row below the current rowCtrl+Enter
  • Insert a row above the current rowCtrl+Shift+Enter

Cursor correlation

  • Move to beginning of line:Home
  • Move to end of line:End
  • Move to end of file:Ctrl+End
  • Move to beginning of file:Ctrl+Home
  • Move to definition:F12
  • Thumbnail at definition: just look at it without jumping over itAlt+F12
  • Move to the second half bracketCtrl+Shift+]
  • Select from cursor to end of lineShift+End
  • Select from the beginning of the line to the cursorShift+Home
  • Delete all words to the right of the cursorCtrl+Delete
  • Shrink/expand selection:Shift+Alt+LeftandShift+Alt+Right
  • Multi cursor: you can select multiple places continuously and modify them together,Alt+ClickAdd cursor orCtrl+Alt+DownorCtrl+Alt+Up
  • Select all matchingCtrl+Shift+L
  • Ctrl+DThe next matching one is also selected (it is customized by me to delete the current line, see belowCtrl+Shift+K)
  • Rewind previous cursor actionCtrl+U

Refactoring code

  • All references found:Shift+F12
  • At the same time, modify all matching:Ctrl+F12
  • Rename: for example, to modify a method name, select it and pressF2, enter a new name, and press enter. You will find that all the files have been modified.
  • Jump to the next error or warning: PressF8Jump one by one
  • View diff right click the file in ExplorerSet file to compare, and then right-click the file to be compared to selectCompare with 'file_name_you_chose'.

Search and replace

  • lookupCtrl+F
  • Search and replaceCtrl+H
  • Find in entire folderCtrl+Shift+F
    Match symbol:
  • *to match one or more characters in a path segment
  • ?to match on one character in a path segment
  • **to match any number of path segments ,including none
  • {}to group conditions (e.g.{**/*.html,**/*.txt}matches all html and txt files)
  • []to declare a range of characters to match (e.g.,example.[0-9]to match onexample.0,example.1, …

Display correlation

  • Full screen:F11
  • zoomIn/zoomOut:Ctrl + =/Ctrl + -
  • Sidebar show / hide:Ctrl+B
  • Four functions of the sidebar are shown:
    • Show ExplorerCtrl+Shift+E
    • Show SearchCtrl+Shift+F
    • Show GitCtrl+Shift+G
    • Show DebugCtrl+Shift+D
  • Show OutputCtrl+Shift+U

Other

  • Autosave: File – > autosave, orCtrl+Shift+P, enter Auto

Modify default shortcut

File -> Preferences -> Keyboard Shortcuts

Modify keybindings.json. My display here is C: \ users \ administrator \ appdata \ roaming \ code \ user \ keybindings.json

// Place your key bindings in this file to overwrite the defaults
[
    //CTRL + space occupied by shortcut key of switching input method
    {
        "key": "ctrl+alt+space",
        "command": "editor.action.triggerSuggest",
        "when": "editorTextFocus"
    },
    //CTRL + D delete a row
    {
        "key": "ctrl+d",
        "command": "editor.action.deleteLines",
        "when": "editorTextFocus"
    },
    {
        "Key": "Ctrl + Shift + k", // interchanged with the shortcut key to delete a row:)
        "command": "editor.action.addSelectionToNextFindMatch",
        "when": "editorFocus"
    },
    //CTRL + Shift + / multiline comment
    {
        "key":"ctrl+shift+/",
        "command": "editor.action.blockComment",
        "when": "editorTextFocus"
    }
]

Plug-in unit

The new version of the support plug-in is installed

Plug in market https://marketplace.visualstudio.com/ ාvscode

Install plug-ins

F1enter extensions

Click first to start the installation or upgrade, orCtrl+Pinputext installGet into
Click the second one to list the installed extensions, from which you can uninstall.