my vscode in ubuntu

做最好的自己🌱

settings.json

{
{
    // =============================== 通用设置 =============================
    "editor.tabSize": 4,    //tab 格数
    "editor.fontSize": 16,  // 编辑区字体大小
    "explorer.autoReveal": false, // 关闭打开文件查看器时文件夹自动展开

    // =============================== git设置 =============================
    // "git.ignoreMissingGitWarning": true,

    // =================================== vim =============================
    // 光标经过代码折叠出不自动展开
    "vim.foldfix": true,
    "vim.easymotion": true,
    "vim.incsearch": true,
    "vim.useSystemClipboard": true,
    "vim.useCtrlKeys": true,
    "vim.hlsearch": true,
    "vim.insertModeKeyBindings": [
        {
            "before": ["j", "k"],
            "after": ["<Esc>"]
        },
    ],
    "vim.normalModeKeyBindingsNonRecursive": [
        // {
        //   "before": ["<leader>", "d"],
        //   "after": ["d", "d"]
        // },
        {
            "before": ["<leader>", "n"],
            "commands": [":nohl"]
        },
        {
            "before": ["<leader>", "w"],
            "commands": [":w"]
        },
        {
            "before": ["<leader>", "q"],
            "commands": [":q"]
        },
        {
            "before": ["K"],
            "after": ["g", "t"]
        },
        {
            "before": ["J"],
            "after": ["g", "T"]
        },
        {
            "before": ["<leader>", "j"],
            "after": ["J"]
        }
        // {
        //     "before": [","],
        //     "after": ["s"]
        // },
        // {
        //     "before": ["<"],
        //     "after": ["S"]
        // }
    ],
    "vim.leader": "<space>",
    "vim.handleKeys": {
        "<C-a>": false,
        "<C-f>": false,
        "<C-b>": false,
        "<C-e>": false,
    },
    "window.zoomLevel": 0,
    "update.mode": "none",
    "extensions.ignoreRecommendations": true,
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],


    // ======================== vim ibus im-select =====================
    // "vim.autoSwitchInputMethod.enable": true,
    // "vim.autoSwitchInputMethod.defaultIM": "xkb:us::eng",
    // "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/bin/ibus engine",
    // "vim.autoSwitchInputMethod.switchIMCmd": "/usr/bin/ibus engine {im}"
    // ================================ python ========================

    // python代码提示的一些配置
    "python.linting.flake8Enabled": true,
    "python.formatting.provider": "yapf",
    "python.linting.flake8Args":[
        "--max-line-length=99"
    ],
    
    "python.linting.pylintEnabled": false,

    "python.linting.pylintArgs": [
      "--load-plugins=pylint_django"
    ],

    // ================================ django ========================
    // 能识别djnago鸭子模型的html
    "emmet.includeLanguages": {
        "django-html": "html"
    },

    "files.associations": {
        "**/*.html": "html",
        "**/templates/**/*.html": "django-html",
        "**/templates/**/*": "django-txt",
        "**/requirements{/**,*}.{txt,in}": "pip-requirements"
    },

    // ===============================eslint====================
    // 保存后自动修复格式
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    // "editor.formatOnSave": true, // 保存自动格式  化
    // 添加vue支持
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        "vue",
        "html"
    ],

    // ===============================sass====================
    "liveSassCompile.settings.formats":[
         // 扩展
        {
            "format": "expanded",//可定制的出口CSS样式(expanded,compact,compressed,nested)
            "extensionName": ".css",//编译后缀名
            "savePath": "~/../css/" //编译保存的路径
        } 

     ],
     // 不生成map文件
    "liveSassCompile.settings.generateMap": false,

    "liveSassCompile.settings.excludeList": [
        "**/node_modules/**",
        ".vscode/**"
    ],

    // 自动添加 兼容性前缀
    "liveSassCompile.settings.autoprefix": [
        "> 1%",
        "last 3 versions"
    ],
    "explorer.confirmDelete": false,
    "liveServer.settings.donotShowInfoMsg": true,
    "editor.accessibilitySupport": "off",
}
}

vue settings.json

{
  "editor.tabSize": 2,
  // ===============================eslint====================
  // 保存后自动修复格式
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  // "editor.formatOnSave": true, // 保存自动格式  化
  // 添加vue支持
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "vue"
  ],
  // ================================ sass ==============================
}

vscode snippet

文件注释(下面是h5的例子)
{
    "Print to console": {
        "prefix": "h5_header",
        "body": [
            "<!--",
            " * @Author: zhangyu",
            " * @Date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
            " * @LastEditors: Please set LastEditors",
            " * @Description: $0",
            " * @FilePath: $RELATIVE_FILEPATH",
            "-->",
        ],
        "description": "Log output to console"
    }

}
vue files
{
    "Print to console": {
        "prefix": "vue",
        "body": [
            "<!--",
            " * @Author: zhangyu",
            " * @Date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
            " * @LastEditors: Please set LastEditors",
            " * @Description: $0",
            " * @FilePath: $RELATIVE_FILEPATH",
            "-->",
            "<template>",
            "    <div class=\"$1\">$2</div>",
            "</template>",
            "",
            "<script>",
            "",
            "export default {",
            "    components: {},",
            "    filters: {},",
            "    data() {",
            "        return {",
            "",
            "        };",
            "    },",
            "    computed: {},",
            "    watch: {},",
            "    created() {},",
            "    mounted() {},",
            "    methods: {}",
            //"    beforeCreate() {},",
            //"    beforeMount() {},",
            //"    beforeUpdate() {},",
            //"    updated() {},",
            //"    beforeDestroy() {},",
            //"    destroyed() {},",
            //"    activated() {},",
            "    };",
            "</script>",
            "<style lang='scss' scoped>",
            "//@import url(); 引入公共css类",
            "",
            "</style>",
            ""
        ],
        "description": "Log output to console"
    }
}

vscode-extends

image.png
image.png
image.png
image.png

esymotion and surround in vscode/vim

esaymotion使用方法
surround部分使用方法

阅读 74
2 声望
0 粉丝
0 条评论
你知道吗?

2 声望
0 粉丝
宣传栏