VSCode插件配置

  1. 安装插件列表:
  2. 自定义配置
  3. 快捷键映射调整
  4. FTP 同步配置

安装VS Code 之后,按快捷键Alt+Shift+P,然后输入 install extensions打开扩展商店。

安装插件列表:

  • Chinese (Simplified) Language Pack 简体中文语言包
  • Python Python开发使用
  • Eslint 写JS用的
  • Path Intellisense 路径提示器
  • Auto Rename Tag 自动重命名HTML标签
  • ftp-sync 远程自动同步文件
  • background VSCode添加背景图片(启动需要管理员权限)

自定义配置

{
    // search.exclude继承了files.exclude,无需重复配置
    "search.exclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/temp": true,
    },
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/node_modules": true,
        "**/*.meta": true,        
        "**/*.class":true,
        "**/*.pyc": true,
        "**/*.pyo": true,
        "**/*.pyd": true,
    },
    "editor.quickSuggestions": {
        "other": true,
        "comments": true,
        "strings": true
    },
    // 格式相关
    "editor.wordWrap": "on",
    "editor.formatOnType": true,
    "editor.detectIndentation": false,
    "editor.renderWhitespace": "all",
    "files.trimTrailingWhitespace": true,   
    "files.autoGuessEncoding": true, 
    // 启用emmet
    "emmet.triggerExpansionOnTab": true,
    "eslint.autoFixOnSave": true,
    "workbench.colorTheme": "Monokai",
    // 默认数据关联
    "files.associations": {
        "*.mq": "vb",
        "*.txt":"log",
        "*.conf":"json"
    },
    "[json]": {
        "files.autoGuessEncoding": false,
    },
    "[log]": {
        "files.autoGuessEncoding": false,
    },
    // 禁用自动更新和插件自动更新(新版本不稳定)
    "update.channel": "none",
    "update.enableWindowsBackgroundUpdates": false,
    "extensions.autoUpdate": false,
    // 禁止上传崩溃和错误报告
    "telemetry.enableCrashReporter": false,
    "telemetry.enableTelemetry": false,
    // nimimap
    "editor.minimap.enabled": true,
    "editor.minimap.showSlider": "always",
    // background
    "background.enabled": true,
    "background.useDefault": false,
    "background.useFront": false,
    "background.customImages": [
        "https://usingbucket.oss-cn-shenzhen.aliyuncs.com/revert_dogs.gif",
        "file:///D:/Pictures/revert_dogs.gif",
    ],
    "background.styles": [
        {
            "opacity": 0.6
        },
        {
            "background-size": "auto 250px",
            "opacity": 0.5
        },
        {
            "background-size": "auto 250px",
            "opacity": 0.5
        }
    ],
    "window.zoomLevel": 0,
}

另修改默认css文件C:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\workbench.main.css(用户版为%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\workbench.main.css),新增如下CSS,用于优化minimap显示,避免minimap遮挡背景图片:

.minimap{opacity:0.5}
.minimap:hover{opacity:1}
.decorationsOverviewRuler{opacity:0.5}

背景图可使用gif动态图片,效果如下:

快捷键映射调整

个人习惯,Ctrl+O打开所在文件夹

[
    {
        "key": "ctrl+o",
        "command": "revealFileInOS",
        "when": "editorFocus"
    },
    {
        "key": "shift+alt+r",
        "command": "-revealFileInOS",
        "when": "!editorFocus"
    },
    {
        "key": "ctrl+shift+u",
        "command": "editor.action.transformToUppercase",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+shift+l",
        "command": "editor.action.transformToLowercase",
        "when": "editorTextFocus"
    }
]

FTP 同步配置

{
    "remotePath": "./path/to/project",
    "host": "192.168.10.10",
    "username": "loginname",
    "password": "",
    "port": 22,
    "secure": true,
    "protocol": "sftp",
    "uploadOnSave": true,
    "passive": false,
    "debug": false,
    "privateKeyPath": "C:\\Users\\<user-name>\\.ssh\\id_rsa",
    "passphrase": "",
    "ignore": [
        "\\.vscode",
        "\\.git",
        "\\.svn",
        "\\.DS_Store",
        "\\.*\\.log"
    ],
    "generatedFiles": {
        "uploadOnSave": true,
        "extensionsToInclude": [],
        "path": ""
    }
}

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 using1174@foxmail.com

文章标题: VSCode插件配置

文章字数: 499

本文作者: Jun

发布时间: 2018-04-24, 15:16:00

最后更新: 2019-04-22, 15:09:14

原始链接: http://yoursite.com/2018/04/24/VSCode插件配置/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

目录
×

喜欢就点赞,疼爱就打赏