Vscode:visual Studio Code Common shortcut keys

Source: Internet
Author: User


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
    1. Open a new window:Ctrl+Shift+N
    2. Close the window:Ctrl+Shift+W
    3. Open multiple editors at the same time (view multiple files)
    4. New fileCtrl+N
    5. Switch between filesCtrl+Tab
    6. Cut out a new editor (Max3)Ctrl+\, or hold downCtrlExplorerthe file name in the mouse click
    7. 3shortcut keysCtrl+1Ctrl+2for the right editor on the leftCtrl+3
    8. 3Switching between editorsCtrl+
    9. Change the position of the editor,Ctrl+kand then pressLeftorRight
Code editing format adjustment
    1. Code line indentationCtrl+[,Ctrl+]
    2. Ctrl+C,Ctrl+Vcopy or cut the current row/current selection
    3. Code formatting:Shift+Alt+F, orCtrl+Shift+Pafter enteringformat code
    4. Move up or down one line:Alt+UporAlt+Down
    5. Copy up one line down:Shift+Alt+UporShift+Alt+Down
    6. Inserts a row below the current lineCtrl+Enter
    7. Insert a row above the current lineCtrl+Shift+Enter
Cursor-related
    1. Move to the beginning of the line:Home
    2. Move to end of line:End
    3. Move to end of file:Ctrl+End
    4. Move to the beginning of the file:Ctrl+Home
    5. Move to Definition:F12
    6. Define a thumbnail: Take a look and not jump pastAlt+F12
    7. Move to the back half bracket:Ctrl+Shift+]
    8. Select from cursor to end of line:Shift+End
    9. Select from the beginning of the line to the cursor:Shift+Home
    10. Delete all words to the right of the cursor:Ctrl+Delete
    11. Expand/Shrink Selection:Shift+Alt+LeftandShift+Alt+Right
    12. Multi-line editing (column editing):Alt+Shift+鼠标左键,Ctrl+Alt+Down/Up
    13. Select all matches at the same time:Ctrl+Shift+L
    14. Ctrl+DThe next match is also selected (in Sublime, the current row is deleted, after the custom key is set andCtrl+Shift+Kswapped)
    15. Fallback previous cursor action:Ctrl+U
Refactoring code
    1. To find all references:Shift+F12
    2. At the same time, modify all matches in this file:Ctrl+F12
    3. 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
    4. Jump to nextErrororWarning: You can jump to a different error when you have multiple errorsF8
    5. 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
    1. FindCtrl+F
    2. Find replacementsCtrl+H
    3. Find in entire folderCtrl+Shift+F
Show related
    1. Fullscreen:F11
    2. Zoomin/zoomout:Ctrl +/-
    3. Side bar Display/hidden:Ctrl+B
    4. Show explorerCtrl+Shift+E
    5. Show SearchCtrl+Shift+F
    6. Show GitCtrl+Shift+G
    7. Show DebugCtrl+Shift+D
    8. 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


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.