{"id":261395,"date":"2023-02-11T08:13:35","date_gmt":"2023-02-11T00:13:35","guid":{"rendered":"https:\/\/gulass.cn\/?p=261395"},"modified":"2023-01-16T15:14:24","modified_gmt":"2023-01-16T07:14:24","slug":"auto-indent-code","status":"publish","type":"post","link":"https:\/\/gulass.cn\/auto-indent-code.html","title":{"rendered":"\u5728 VSCode \u4e2d\u81ea\u52a8\u7f29\u8fdb\u4ee3\u7801\u6307\u5357"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4ee3\u7801\u4e2d\u7684\u7f29\u8fdb\u6307\u7684\u662f\u4f60\u5728\u4ee3\u7801\u884c\u7684\u5f00\u5934\u5904\u7684\u7a7a\u683c\u3002\u50cf\u5176\u4ed6\u4ee3\u7801\u7f16\u8f91\u5668\u548c IDE \u4e00\u6837\uff0cVSCode \u5141\u8bb8\u4f60\u81ea\u52a8\u7f29\u8fdb\u4f60\u7684\u4ee3\u7801\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u4f7f\u7528\u5236\u8868\u7b26\u6216\u7a7a\u683c\u6216\u4efb\u4f55\u4f60\u559c\u6b22\u7684\u7f29\u8fdb\u65b9\u5f0f\u3002<\/p>\n

\u542c\u8d77\u6765\u4e0d\u9519\u5427\uff1f\u8ba9\u6211\u4eec\u6765\u770b\u770b\u600e\u4e48\u505a\u3002<\/p>\n

\u5728 VSCode \u4e2d\u542f\u7528\u81ea\u52a8\u7f29\u8fdb<\/strong><\/div>\n

\u4f60\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u4e2a\u76ee\u6807\u3002\u5728\u672c\u6307\u5357\u4e2d\uff0c\u6211\u5c06\u5411\u4f60\u5c55\u793a\u4e09\u79cd\u5728 VSCode \u4e2d\u81ea\u52a8\u7f29\u8fdb\u4ee3\u7801\u7684\u65b9\u6cd5\u3002<\/p>\n

\u65b9\u6cd5 1\uff1a\u914d\u7f6e\u5168\u5c40\u7528\u6237\u8bbe\u7f6e<\/strong><\/span><\/div>\n

\u4f60\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u6a21\u5f0f\u8bbf\u95ee\u5168\u5c40\u7528\u6237\u8bbe\u7f6e\u3002\u4f7f\u7528 Ctrl + Shift + P \u6765\u6253\u5f00\u547d\u4ee4\u6a21\u5f0f\uff0c\u641c\u7d22 Open User Settings \u5e76\u6309\u4e0b\u56de\u8f66\uff1a<\/p>\n

\"\"<\/p>\n

\u5b83\u5c06\u6253\u5f00\u8bbe\u7f6e\u3002\u5728\u90a3\u91cc\uff0c\u4f60\u9700\u8981\u641c\u7d22 Auto Indent\uff0c\u5e76\u5728 \u201c\u7f16\u8f91\u5668\uff1a\u81ea\u52a8\u7f29\u8fdbEditor: Auto Indent\u201d \u4e2d\u9009\u62e9 \u201c\u5168\u90e8Full\u201d\uff1a<\/p>\n

\"\"<\/p>\n

\u63a5\u7740\u81ea\u52a8\u7f29\u8fdb\u4f1a\u88ab\u542f\u7528\uff0c\u5e76\u5e94\u7528\u4e8e VSCode \u4e2d\u6bcf\u4e2a\u6253\u5f00\u7684\u6587\u4ef6\u3002<\/p>\n

\u65b9\u6cd5 2\uff1a\u5728 VSCode \u4e2d\u4f7f\u7528\u68c0\u67e5\u5668\u6216\u683c\u5f0f\u5316\u5de5\u5177\u8fdb\u884c\u81ea\u52a8\u7f29\u8fdb<\/strong><\/span><\/div>\n

\u5728\u8fd9\u79cd\u65b9\u6cd5\u4e2d\uff0c\u4f60\u9700\u8981\u6dfb\u52a0\u6269\u5c55\u7a0b\u5e8f\uff0c\u5982\u4ee3\u7801\u683c\u5f0f\u5316\u5de5\u5177\u6216\u8005\u68c0\u67e5\u5668\uff0c\u4ee5\u83b7\u5f97\u7406\u60f3\u7684\u7ed3\u679c\u3002<\/p>\n

\u68c0\u67e5\u5668Linter\u4f1a\u8bc6\u522b\u4ee3\u7801\u4e2d\u7684\u9519\u8bef\uff0c\u800c\u683c\u5f0f\u5316\u5de5\u5177Formatter\u53ea\u5bf9\u4f60\u7684\u4ee3\u7801\u8fdb\u884c\u683c\u5f0f\u5316\uff0c\u4f7f\u5176\u66f4\u5177\u53ef\u8bfb\u6027\u3002\u4f60\u53ef\u4ee5\u5728 VSCode \u5e02\u573a \u4e2d\u641c\u7d22\u7279\u5b9a\u4e8e\u4f60\u7684\u7f16\u7a0b\u8bed\u8a00\u7684\u4ee3\u7801\u683c\u5f0f\u5316\u5668\u3002<\/p>\n

\u8fd9\u91cc\u6709\u4e00\u4e9b\u6211\u6700\u559c\u6b22\u7684\u5e7f\u6cdb\u6d41\u884c\u8bed\u8a00\u7684\u4ee3\u7801\u683c\u5f0f\u5316\u5de5\u5177\u548c\u68c0\u67e5\u5668\uff1a<\/p>\n

    \n
  1. C\/C++\uff1a\u9002\u7528\u4e8e C \u548c C++ \u7f16\u7a0b\u8bed\u8a00\u3002<\/li>\n
  2. PHP\uff1a\u9002\u7528\u4e8e PHP\u3002<\/li>\n
  3. markdownlint\uff1a\u9002\u7528\u4e8e Markdown \u6587\u4ef6\u3002<\/li>\n
  4. Python\uff1a\u9002\u7528\u4e8e Python \u7f16\u7a0b\u8bed\u8a00\u3002<\/li>\n
  5. ESLint\uff1a\u9002\u7528\u4e8e JSON \u548c javascript\u3002<\/li>\n
  6. Beautify: \u9002\u7528\u4e8e JavaScript\u3001JSON\u3001CSS\u3001SASS \u548c HTML\u3002<\/li>\n<\/ol>\n

    \u5f53\u4f60\u4e3a\u4f60\u559c\u6b22\u7684\u7f16\u7a0b\u8bed\u8a00\u6dfb\u52a0\u4e86\u683c\u5f0f\u5316\u5de5\u5177\uff0c\u4f60\u53ef\u4ee5\u6309 Ctrl + Shift + I \u6765\u683c\u5f0f\u5316\u4ee3\u7801\u3002<\/p>\n

    \u540c\u6837\u5730\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u6a21\u5f0f\u505a\u540c\u6837\u7684\u4e8b\u60c5\u3002\u6309 Ctrl + Shift + P\uff0c\u5e76\u641c\u7d22 Format document\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u3002<\/p>\n

    \"\"<\/p>\n

    \u65b9\u6cd5 3\uff1a\u5728\u4fdd\u5b58\u6587\u4ef6\u65f6\u542f\u7528\u81ea\u52a8\u7f29\u8fdb\u529f\u80fd<\/strong><\/span><\/div>\n

    VSCode \u5141\u8bb8\u4f60\u5728\u4fdd\u5b58\u4f60\u7684\u4ee3\u7801\u65f6\uff0c\u901a\u8fc7\u4e00\u4e2a\u5c0f\u5c0f\u7684\u8c03\u6574\u6765\u683c\u5f0f\u5316\u5b83\u3002\u8ba9\u6211\u544a\u8bc9\u4f60\u600e\u4e48\u505a\u3002<\/p>\n

    \u6309 Ctrl + ,\uff0c\u5b83\u5c06\u6253\u5f00\u7528\u6237\u8bbe\u7f6e\u63d0\u793a\u3002\u5728\u90a3\u91cc\uff0c\u641c\u7d22 Format On Save\u3002<\/p>\n

    \"\"<\/p>\n

    \u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u5f53\u4f60\u4fdd\u5b58\u6587\u4ef6\u65f6\uff0c\u4f60\u7684\u6587\u4ef6\u5c06\u81ea\u52a8\u6dfb\u52a0\u7f29\u8fdb\u3002<\/p>\n

    \u603b\u7ed3<\/strong><\/div>\n

    \u5728\u672c\u6307\u5357\u4e2d\uff0c\u89e3\u91ca\u4e86\u5982\u4f55\u5728 VSCode \u4e2d\u81ea\u52a8\u6dfb\u52a0\u7f29\u8fdb\u3002\u5efa\u8bae\u4f7f\u7528\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u4f60\u53ef\u4ee5\u8bbe\u7f6e\u4f7f\u7528\u5236\u8868\u7b26\u6216\u7a7a\u683c\u6216\u4efb\u4f55\u4f60\u559c\u6b22\u7684\u7f29\u8fdb\u65b9\u5f0f\u3002 \u542c\u8d77\u6765\u4e0d\u9519\u5427\uff1f\u8ba9\u6211\u4eec\u6765\u770b\u770b\u600e\u4e48\u505a\u3002 \u4f60\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u8fd9 […]<\/p>\n","protected":false},"author":1470,"featured_media":261402,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-261395","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/261395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1470"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=261395"}],"version-history":[{"count":5,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/261395\/revisions"}],"predecessor-version":[{"id":262599,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/261395\/revisions\/262599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/261402"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=261395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=261395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=261395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}