自学内容网 自学内容网

vscode设置特定扩展名文件的打开编码格式

用vscode 编辑c语言或者Verilog代码, 由于其它开发工具的文件编码格式无法修改,默认只能是gb2312, 与我们国内奉行的统一 utf8 不一致. 所以只能是更改特殊文件的打开方式. 配置方式如下.
在这里插入图片描述
关键配置如下:

{
    "git.openRepositoryInParentFolders": "never",
    "Codegeex.Privacy": true,
    "EIDE.ARM.INI.Path": "d:\\Keil_v5\\UV4\\UV4.exe",
    "terminal.integrated.scrollback": 3000,
    "workbench.editorAssociations": {
        "*.c": "default"
    },
    "Codegeex.Comment.LanguagePreference": "中文",
    "files.associations": {
        "*.v": "verilog",
        "*.c": "c",
        "*.h": "c"
    },
    "[c]": { 
            "files.encoding": "gb2312" //设置verilog文件编码
    },
    "[verilog]": { 
            "files.encoding": "gb2312" //设置verilog文件编码
    },
    "Codegeex.Local": {
        "apiURL": "",
        "useChatGLM": true,
        "chatGLM": {
            "apiKey": "",
            "model": ""
        },
        "chat": {
            "useDefaultSystemPrompt": true,
            "systemPrompt": "",
            "temperature": 0.2,
            "top_p": 0.95,
            "max_tokens": 1024,
            "presence_penalty": 1
        },
        "completions": {
            "useDefaultSystemPrompt": true,
            "systemPrompt": "",
            "temperature": 0.2,
            "top_p": 0.95,
            "max_tokens": 64,
            "presence_penalty": 1
        }
    },
    "editor.fontFamily": "宋体,Consolas, 'Courier New', monospace",
    "editor.inlayHints.fontFamily": "宋体",
    "Codegeex.License": ""
}

原文地址:https://blog.csdn.net/phker/article/details/142981065

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!