Vscode:visual Studio Code Common shortcut keys
Main Command Box
F1orCtrl+Shift+P: Open the Command panel. In the input box that opens, you can enter any command, for example:
- ClickBackspaceto enter theCtrl+Pmode
- Ctrl+PEnter the>mode under inputCtrl+Shift+P
Ctrl+Punder the window you can also:
- Directly enter the file name, jump to the files
- ?List the currently executable actions
- !DisplayErrorsorWarnings, you can alsoCtrl+Shift+M
- :Jump to the number of lines, or you canCtrl+Ggo directly to
- @Jump tosymbol(search for a variable or function), or you canCtrl+Shift+Ogo directly to
- @Depending on the category jumpsymbol, find the property or function, or you canCtrl+Shift+Oenter: Enter
- #Search by namesymbol, or you canCtrl+T
Frequently used shortcut key Editor and window management
- Open a new window:Ctrl+Shift+N
- Close the 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 (Max3)Ctrl+\, or hold downCtrlExplorerthe file name in the mouse click
- 3shortcut keysCtrl+1Ctrl+2for the right editor on the leftCtrl+3
- 3Switching between editorsCtrl+
- Change the position of the editor,Ctrl+kand then pressLeftorRight
Code editing format adjustment
- Code line indentationCtrl+[,Ctrl+]
- Ctrl+C,Ctrl+Vcopy or cut the current row/current selection
- Code formatting:Shift+Alt+F, orCtrl+Shift+Pafter enteringformat code
- Move up or down one line:Alt+UporAlt+Down
- Copy up one line down:Shift+Alt+UporShift+Alt+Down
- Inserts a row below the current lineCtrl+Enter
- Insert a row above the current lineCtrl+Shift+Enter
Cursor-related
- Move to the beginning of the line:Home
- Move to end of line:End
- Move to end of file:Ctrl+End
- Move to the beginning of the file:Ctrl+Home
- Move to Definition:F12
- Define a thumbnail: Take a look and not jump pastAlt+F12
- Move to the back half bracket:Ctrl+Shift+]
- Select from cursor to end of line:Shift+End
- Select from the beginning of the line to the cursor:Shift+Home
- Delete all words to the right of the cursor:Ctrl+Delete
- Expand/Shrink Selection:Shift+Alt+LeftandShift+Alt+Right
- Multi-line editing (column editing):Alt+Shift+鼠标左键,Ctrl+Alt+Down/Up
- Select all matches at the same time:Ctrl+Shift+L
- Ctrl+DThe next match is also selected (in Sublime, the current row is deleted, after the custom key is set andCtrl+Shift+Kswapped)
- Fallback previous cursor action:Ctrl+U
Refactoring code
- To find all references:Shift+F12
- At the same time, modify all matches in this file:Ctrl+F12
- Rename: For example, to modify a method name, you can select and pressF2, enter a new name, return, you will find all the files have been modified
- Jump to nextErrororWarning: You can jump to a different error when you have multiple errorsF8
- Viewdiff:explorerSelect the file right button in the fileSet file to compareand then need to compare the files right-click onCompare with file_name_you_chose
Find replacements
- FindCtrl+F
- Find replacementsCtrl+H
- Find in entire folderCtrl+Shift+F
Show related
- Fullscreen:F11
- Zoomin/zoomout:Ctrl +/-
- Side bar Display/hidden:Ctrl+B
- 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, enterauto
Modify default shortcut keys
To open the default keyboard shortcut settings:
File -> Preferences -> Keyboard ShortcutsOr:Alt+F -> p -> k
Modifykeybindings.json:
// Place your key bindings in this file to overwrite the defaults
[
// ctrl+space is occupied by the switch input method shortcut
{
"key": "ctrl+alt+space",
"command": "editor.action.triggerSuggest",
"when": "editorTextFocus"
},
// ctrl+d deletes a row
{
"key": "ctrl+d",
"command": "editor.action.deleteLines",
"when": "editorTextFocus"
},
// Swap with a shortcut that deletes a row
{
"key": "ctrl+shift+k",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
// ctrl+shift+/multiline comment
{
"key":"ctrl+shift+/",
"command": "editor.action.blockComment",
"when": "editorTextFocus"
},
/ / Customize the same case conversion shortcuts as sublime, you need to install the TextTransform plugin
{
"key": "ctrl+k ctrl+u",
"command": "uppercase",
"when": "editorTextFocus"
},
{
"key": "ctrl+k ctrl+l",
"command": "lowercase",
"when": "editorTextFocus"
}
]
Front-end development prerequisites
- 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
Custom Settings Reference
Vscode Custom Configuration reference:
{
"editor.fontSize": 18,
"files.associations": {
"*.es": "javascript",
"*.es6": "javascript"
},
// Controls whether the editor should render whitespace characters
"editor.renderWhitespace": true,
// When enabled, trailing spaces are trimmed when the file is saved.
"files.trimTrailingWhitespace": true,
// File extensions that can be beautified as javascript or JSON.
"beautify.JSfiles": [
"",
"es",
"es6",
"js",
"json",
"jsbeautifyrc",
"jshintrc"
]
}
Related references
Official shortcut key Daquan: https://code.visualstudio.com/docs/customization/keybindings
http://blog.csdn.net/u010019717/article/details/50443970
Vscode:visual Studio Code Common shortcut keys