最近在VScode中输入中文字符总是莫名奇妙将中文字符替换为字母,另外输入中文标点符号,会自动将前一个中文字符一替换为对应符号(变成两个中文符号)。
现在输入注释和中文麻烦死了,都不知问题出在哪?拜托有知道原因或者遇过相同问题的小伙伴支个招啊~~~
下面附上自己的设置,麻烦大神们支支招,郁闷死了~
{
// 主題
"workbench.colorTheme": "Bluloco Dark Italic",
"workbench.iconTheme": "material-icon-theme",
// 換行
"editor.wordWrap": "on",
// 代码缩进修改成2个空格
"editor.tabSize": 2,
// 不檢查縮進,保存后統一按設置項來設置
"editor.detectIndentation": false,
//保存的时候自动格式化
"editor.formatOnSave": true,
// 字體大小
"editor.fontSize": 14,
// 設置行高
"editor.lineHeight": 24,
"editor.linkedEditing": true,
"files.autoSave": "afterDelay",
// 左側工具欄是否可見
"workbench.activityBar.visible": true,
// 控制何时自动保存已更新文件。接受的值: "off"、"afterDelay"、"onFocusChange" (编辑器失去焦点)、"onWindowChange" (窗口失去焦点)。如果设置为 "afterDelay",可在 "files.autoSaveDelay" 中配置延迟时间。
// VScode主题配置
"editor.renderLineHighlight": "none",
"editor.renderWhitespace": "none",
"editor.fontFamily": "Consolas",
"editor.cursorBlinking": "smooth",
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.wordWrapColumn": 200,
// 保存时自动格式化
"editor.formatOnPaste": false,
"files.trimTrailingWhitespace": true,
"terminal.integrated.shell.windows": "C:\\windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"typescript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"javascript.suggest.autoImports": true,
"workbench.startupEditor": "newUntitledFile",
"workbench.colorCustomizations": {
// 设置guide线高亮颜色
"editorIndentGuide.activeBackground": "#ff0000"
},
// 启用/禁用导航路径
"breadcrumbs.enabled": true,
// git 部分配置
// 配置gitlen中git提交历史记录的信息显示情况
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": false,
"suppressNoRepositoryWarning": false,
"suppressResultsExplorerNotice": false,
"suppressShowKeyBindingsNotice": true,
"suppressUpdateNotice": true,
"suppressWelcomeNotice": false
},
"git.path": "C:/Program Files/Git/cmd/git.exe",
// git是否启用自动拉取
"git.autofetch": true,
"git.confirmSync": false,
//minapp
"minapp-vscode.disableAutoConfig": true,
// VScode 文件搜索区域配置
"search.exclude": {
"**/dist": true,
"**/build": true,
"**/elehukouben": true,
"**/.git": true,
"**/.gitignore": true,
"**/.svn": true,
"**/.DS_Store": true,
"**/.idea": true,
"**/.vscode": false,
"**/yarn.lock": true,
"**/tmp": true
},
// 配置文件关联
"files.associations": {
"*.vue": "vue",
"*.wxss": "css",
"*.cjson": "jsonc",
"*.wxs": "javascript"
},
// 启用后,按下 TAB 键,将展开 Emmet 缩写。
"emmet.triggerExpansionOnTab": true,
// 配置emmet对文件类型的支持
"emmet.syntaxProfiles": {
"vue-html": "html",
"vue": "html",
"javascript": "javascriptreact",
"xml": {
"attr_quotes": "single"
}
},
// 在react的jsx中添加对emmet的支持
"emmet.includeLanguages": {
"jsx-sublime-babel-tags": "javascriptreact",
"wxml": "html"
},
// js设置单引号
"javascript.preferences.quoteStyle": "single",
// 让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
// vetur设置
"vetur.format.defaultFormatter.js": "js-beautify-html",
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.options.useTabs": true,
"vetur.format.scriptInitialIndent": true,
"vetur.ignoreProjectWarning": true,
"vetur.useWorkspaceDependencies": true,
"vetur.validation.templateProps": true,
"vetur.format.styleInitialIndent": true,
// vue组件中html代码格式化样式
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned"
},
// 是否开启eslint检测
"eslint.enable": false,
// 文件保存时,是否自动根据eslint进行格式化
"eslint.autoFixOnSave": true,
"prettyhtml": {
"printWidth": 160, // No line exceeds 160 characters
"singleQuote": false // Prefer double quotes over single quotes
},
"prettier": {
"printWidth": 300,
"semi": false,
"singleQuote": true
}
},
// 使用eslint 風格使用standard 進行代碼規則限制
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"typescript",
"typescriptreact",
{
"language": "vue",
"autoFix": true
},
],
// 格式化快捷键 shirt+alt+F
// prettier进行格式化时是否安装eslint配置去执行,建议false
// 调试,本地服务器配置
// 格式化快捷键 shirt+alt+F
// #让prettier使用eslint的代码格式进行校验
"prettier.eslintIntegration": true,
// #去掉代码结尾的分号
"prettier.semi": false,
// #使用带引号替代双引号
"prettier.singleQuote": true,
//自动保存信息
// By default, create file username
"fileheader.Author": "bianjian",
// By default, update file username.
"fileheader.LastModifiedBy": "bianjian",
// By default, common template. Do not modify it!!!!!
"fileheader.tpl": "/*\r\n * @Author: {author}\n * @Date: {createTime}\n * @Last Modified by: {lastModifiedBy}\n * @Last Modified time: {updateTime}\n */\n",
"editor.quickSuggestions": {
"strings": true
},
// 调试,本地服务器配置
"launch": {
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Node.js",
"program": "${file}"
},
{
"type": "chrome",
"request": "launch",
"name": "vuejs: chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}/src",
"breakOnLoad": true,
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
}
],
"compounds": []
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"tabnine.experimentalAutoImports": true,
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"guides.enabled": false,
"typescript.format.semicolons": "remove",
"javascript.format.semicolons": "remove",
"editor.mouseWheelZoom": true,
"explorer.confirmDelete": false,
"[html]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"prettier.endOfLine": "auto",
"[css]": {
"editor.defaultFormatter": "michelemelluso.code-beautifier"
},
"explorer.confirmDragAndDrop": false,
"window.zoomLevel": 1,
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"cSpell.userWords": [
"Submenu",
"cascader"
],
"mssql.connections": [
{
"server": "{<!-- -->{put-server-name-here}}",
"database": "{<!-- -->{put-database-name-here}}",
"user": "{<!-- -->{put-username-here}}",
"password": ""
}
],
}
可能是overtype插件导致的(https://github.com/AdamMaras/vscode-overtype/issues/24),如果用了的话先禁用了吧等修复,如果没用这个插件的话当我没说...
可以尝试升级到最新版本的vscode尝试解决
我也一样的问题,是什么地方出问题了?楼主最后怎么顺利解决的
如果受到中文输入法困扰,可以安装 vscode 插件 "半角",【中文,符号】自动转 [英文,符号]