标签搜索

vscode插件

指针原来是套娃的
2025-03-21 / 0 评论 / 31 阅读 / 正在检测是否收录...

因为换了几台电脑,每次都要重新安装vscode和插件,这里记录一下用到的插件和对应的配置。

Chinese (Simplified) (简体中文) Language

vscode简体中文配置

Live Server

建立本地服务器,实时显示服务器端页面

Remote Repositories

查看远程仓库

Code Runner

执行node代码

indent-rainbow

缩进颜色显示

Draw.io Integration

绘图插件

any-rule

多种正则

Regex Previewer

检查正则

ESLint

检查js格式化

Prettier - Code formatter

格式化检查与修复

GitLens — Git supercharged

显示git提交

CodeGeeX: AI Coding Assistant

智谱ai编程助手

Markdown Preview Enhanced

markdown文件预览显示

  • 首选项 开启Enable Script Execution(js脚本执行) 启用目录
  • F1 搜索 markdown preview enhanced: customize css 配置css样式

    /* Please visit the URL below for more information: */
    /*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */ 
     
    .markdown-preview.markdown-preview {
      // modify your style here
      // eg: background-color: blue;  
      font-family: "consolas", "Noto Sans S Chinese";
      font-size: 1em;
    }
    
    .markdown-img-description{
        text-align: center;
        margin-top: -1em;
        color: #666;;
        margin-bottom: 2em;
    }
    
    html body img{
        border:2px solid #ccc;
    }
    
    .markdown-p-center{
        text-align: center;
    }
  • F1 搜索 markdown preview enhanced: extend parser 配置js

    const scripts = `
    <script>
        function setCurrent(){
            const links = document.querySelectorAll(".md-sidebar-toc a")
            for(const link of links){
                link.style.color="";
            }
            const hash = location.hash;
            const a = document.querySelector('a[href="'+hash+'"]');
            if(a){
                a.style.color = "#f40";
            }
        }
        setCurrent();
        window.onhashchange = setCurrent;
    </script>
    `;
    var fs = require("fs");
    module.exports = {
      onWillParseMarkdown: function(markdown) {
        return new Promise((resolve, reject) => {
          const reg = /\!\[(.*)\]\((\S+)\)/gm;
          markdown = markdown.replace(reg, function(match, g1, g2) {
            var width = "100%";
            if (g1) {
              var w = g1.split("|");
              if (w.length > 1) {
                width = w[1] + "px";
                g1 = w[0];
              }
            }
            return `
    <p class="markdown-p-center">
      <img src="${g2}" alt="${g1}" style="max-width:${width}"/>
    </p>
    <p class="markdown-img-description">
      ${g1}
    </p>
      `;
          });
          resolve(markdown);
        });
      },
      onDidParseMarkdown: function(html) {
        return new Promise((resolve, reject) => {
          return resolve(scripts + html);
        });
      }
    };
    
0

评论

博主关闭了所有页面的评论