VS Code installation plugins, custom templates, custom configuration parameters, custom themes, configuration parameter descriptions, commonly used extension plugins

1. Download and official website tutorial

2. Install the plugin

There are three ways to install extensions:

  • Selection Code>Preferences>Extensions;
  • Use shortcut keys Ctrl+Shift+X;
  • Use shortcut keys Ctrl+Shift+Pto enter the command panel, enter the Extensions: Install Extensionssearch extension and install it;

3. Customize the template

Select Code>Preferences>User Snippetsor use the shortcut keys Ctrl+Shift+Pto enter the command panel, input Preferences: Configure User Snippetsmanage custom code segments.

Click New Global Snippets file...New Custom code snippet:custom.code-snippets

{
    
    
    "Author Info": {
    
    
        "scope": "cpp,go, python",
        "prefix": "author",
        "body": [
            "/**",
            "* $1",
            "* @author wohu",
            "*/",
            "$2"
        ],
        "description": "Author Infomartion"
    }
}

After the above-described configuration custom code stored in the cpp,go, pythoninput file authorto generate self-defined code segment.

4. Custom configuration parameters

Enter the shortcut key Ctrl+,to enter the configuration page, search for keywords to adjust the configuration parameters.

settings.json

Can also settings.jsonedit custom configuration:

{
    
    
    "editor.fontSize": 14, // 字体大小
    "editor.formatOnSave": true, // 保存时自动格式化
    "files.autoSave": "onFocusChange", // 失去焦点时自动保存文件
    "breadcrumbs.enabled": true, // 显示文件路径
    "window.zoomLevel": 0, // 窗口缩放比例
    "workbench.statusBar.visible": true, // 隐藏底部状态栏
    "workbench.colorTheme": "An Old Hope Italic" // 编辑器主题
}

5. Custom Theme

VS Code built many different styles of theme editor, enter the shortcut key to Ctrl+K、Ctrl+Tpop up the theme selection screen, you can choose own theme. You can also install third-party themes in the extension center and then enable them here.

You can also select the menu: File> Preferences> Color Theme
Insert picture description here

6. Configuration parameter description

{
    
    
    "editor.fontSize": 14, // 字体大小
    "editor.formatOnSave": true, // 保存时自动格式化
    "files.autoSave": "onFocusChange", // 失去焦点时自动保存文件
    "breadcrumbs.enabled": true, // 显示文件路径
    "window.zoomLevel": 0, // 窗口缩放比例
    "workbench.statusBar.visible": true, // 隐藏底部状态栏
    "workbench.colorTheme": "An Old Hope Italic", // 编辑器主题
    "workbench.iconTheme": "eq-material-theme-icons-ocean", // 图标主题
    "workbench.startupEditor": "newUntitledFile", // 编辑器欢迎设置    
    "explorer.confirmDragAndDrop": false, // 移动文件时是否需要确认
    "explorer.confirmDelete": false, // 删除文件时是否需要确认
    // 优化右侧预览地图样式
    "editor.minimap.renderCharacters": false,
    "editor.minimap.maxColumn": 200,
    "editor.minimap.showSlider": "always",
    // go开发配置
    "go.buildOnSave": "workspace",
    "go.lintOnSave": "package",
    "go.vetOnSave": "package",
    "go.buildFlags": [],
    "go.lintFlags": [],
    "go.vetFlags": [],
    "go.coverOnSave": false,
    "go.autocompleteUnimportedPackages": true,
    "go.useLanguageServer": true,
    "go.inferGopath": true,
    "go.docsTool": "godoc",
    "go.gocodePackageLookupMode": "go",
    "go.gotoSymbol.includeImports": true,
    "go.useCodeSnippetsOnFunctionSuggest": true,
    "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
    "go.formatTool": "goreturns",
    "go.gocodeAutoBuild": false,
    "go.liveErrors": {
    
    
        "enabled": true,
        "delay": 0
    },
    "go.gopath": "/data/go",
    "go.goroot": "/usr/local/go/1.12.7/libexec"
}

7. Extension

Guess you like

Origin blog.csdn.net/wohu1104/article/details/111463997