Visual Studio Code's standing shortcut key

Source: Internet
Author: User


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





Visual Studio Code is a great editor that starts very fast and can be used entirely in place of other text file editing tools. can also be used to do development, support a variety of languages, compared to other Ides, lightweight fully configurable also integrates git feel very suitable for front-end development. So I studied it carefully. The future of the document may be used as the main tool.


Main Command Box


The most important function isF1toCtrl+Shift+POpen the command panel, in this command box can be executed vscode any command, or even close the editor.
ClickBackspaceto get into theCtrl+Ppattern.
TheCtrl+Pinput>can also be returned to theCtrl+Shift+Pmode.
Ctrl+Punder the window can also



Directly enter the filename, jump to file?list the currently executable action!display errors or warnings, can also ' ctrl+shift+m:jump to the number of lines, you canCtrl+Gdirectly enter@Jump to symbol (search for variables or functions), or you canCtrl+Shift+Ogo directly@:to the category jump symbol, look for properties or functions, orCtrl+Shift+OEnter enter:#by name to find symbol, or you canCtrl+T


Common shortcut keys Editor and Window management open multiple windows at the same time (view multiple items)


Open a new window:Ctrl+Shift+NClose the window:Ctrl+Shift+W


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


Ctrl+Nswitch between new file filesCtrl+Tabcut out a new editor (up to 3)Ctrl+\, or you can press CTRL + click on the Explorer file name in the left Middle right 3 editor shortcut keyCtrl+1Ctrl+2Ctrl+33 Editor Cycle Ctrl + ' Editor to change position,Ctrl+kthen pressLeftorRight


Code editing format adjustment


Code line indentationCtrl+[Ctrl+]Ctrl+CCtrl+VIf unchecked, the default copy or cut a whole line of code is formatted:Shift+Alt+F, orCtrl+Shift+Pafter the inputformat codemoves up orAlt+UpAlt+DowndownShift+Alt+Upone line: or up and down: orShift+Alt+Downinserts a row below the current lineCtrl+Enterinserts a row above the current lineCtrl+Shift+Enter


Cursor-related


Move to the beginning of the line: move to the end of the file: Move to the beginning of the document: Move to the start of the file-move to theHomeEnddefinition:Ctrl+EndCtrl+HomeF12define a thumbnail: just one look without jumping pastAlt+F12move to the back half bracketCtrl+Shift+]Select from cursor to endShift+Endof line SelectShift+HomeDelete all characters from the beginning of the line to the right of the cursorCtrl+DeleteShrink/expand selection:Shift+Alt+LeftandShift+Alt+Rightmulti-cursor: You can select multiple places consecutively, then modify them together,Alt+Clickadd the cursor orCtrl+Alt+DownorCtrl+Alt+Upat the same time check all matches theCtrl+Shift+LCtrl+Dnext match is also selected (by my custom to delete the current line, see belowCtrl+Shift+K) fallback previous cursor actionCtrl+U


Refactoring code


Find All references:Shift+F12also modify all matches in this file:Ctrl+F12rename: 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 the next error or warning: when there are multiple errors, you can pressF8jump to see diff in Explorer, select File RightSet file to compare, and then right-click on file to compareCompare with ‘file_name_you_chose‘.


Find replacements


Find FindCtrl+FreplaceCtrl+Hentire folder findCtrl+Shift+F
Match: To*match one or more characters in a path segment to?match on one character in a path segment to**Mat Ch any number of the 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., toexample.[0-9]match onexample.0,example.1...


Show related


Full screen:F11zoomin/zoomout:Ctrl + =/Ctrl + -side bar Display/hidden:Ctrl+BSidebar 4 big function show: Show ExplorerCtrl+Shift+Eshow SearchCtrl+Shift+Fshow GitCtrl+Shift+Gshow debug< C7/>show OutputCtrl+Shift+U


Other


AutoSave: File--AutoSave, orCtrl+Shift+P, enter auto


Modify default shortcut keys


Keyboard shortcuts, Preferences, File--



Modifykeybindings.jsonthat my show hereC:\Users\Administrator\AppData\Roaming\Code\User\keybindings.json


// Place your key bindings in this file to overwrite the defaults
[
     //ctrl+space is switched by the input method shortcut key
     {
         "key": "ctrl+alt+space",
         "command": "editor.action.triggerSuggest",
         "when": "editorTextFocus"
     },
     // ctrl+d deletes a line
     {
         "key": "ctrl+d",
         "command": "editor.action.deleteLines",
         "when": "editorTextFocus"
     },
     {
         "key": "ctrl+shift+k", // swapped with the shortcut to delete a line :)
         "command": "editor.action.addSelectionToNextFindMatch",
         "when": "editorFocus"
     },
     //ctrl+shift+/multiline comments
     {
         "key":"ctrl+shift+/",
         "command": "editor.action.blockComment",
         "when": "editorTextFocus"
     }
] 




Plug - ins


The new version supports Plug-in installation



Plug-in market https://marketplace.visualstudio.com/


Installing plugins


F1Inputextensions






Click the first one to start the installation or upgrade, or you canCtrl+Penterext install
Clicking the second will list the extensions that have been installed and can be uninstalled from



Visual Studio Code's standing shortcut key


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.