一、快捷键的配置
1.向上(下)复制一行: shift+alt+w(s)
2.向上(下)移动行:alt+w(s)
3.向上(下)插入行:shift+enter/alt+e(d)
4.删除一行:ctrl+D
二、vscode插件的配置
-
prettier的配置
根据网上参考的大多配置,基本没用!最长说的就是在prettier里面设置Prettier Path的值。如果你直接在vscode里面编辑设置的话
无论是json写进去,还是设置里面填写进去,都没用!
我不确定这是不是bug
最终解决方案
直接在项目根目录创建 .prettierrc 文件我感觉吧,只有在配置文件里面写参数才有用。其他的都扯蛋!
然后填写内容如下:
{
"printWidth": 200,
"eslintIntegration": true,
"stylelintIntegration": true,
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"files.insertFinalNewline": true,
"useTabs": false,
"endOfLine": "auto",
"ignorePath": ".gnore",
"trailingComma": "none"
}
参考:vscode格式化Prettier 配置(解决自动换行问题)