{"id":21393,"date":"2024-11-19T08:44:00","date_gmt":"2024-11-19T00:44:00","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21393\/"},"modified":"2024-11-19T08:44:00","modified_gmt":"2024-11-19T00:44:00","slug":"vscode%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%ae%e5%89%8d%e5%90%8e%e7%a9%ba%e6%a0%bc","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21393\/","title":{"rendered":"vscode\u600e\u4e48\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c"},"content":{"rendered":"<blockquote><p>\n  vscode \u4e2d\u53ef\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c\uff0c\u5305\u62ec\uff1a\u2460 tab size\uff1a\u8bbe\u5b9a\u4e00\u4e2a tab \u952e\u8868\u793a\u7684\u7a7a\u683c\u6570\uff1b\u2461 insert spaces\uff1a\u6309 tab \u952e\u63d2\u5165\u7a7a\u683c\uff0c\u800c\u975e\u5236\u8868\u7b26\uff1b\u2462 trim trailing whitespace\uff1a\u4fdd\u5b58\u65f6\u81ea\u52a8\u5220\u9664\u6587\u4ef6\u5c3e\u90e8\u7a7a\u767d\u5b57\u7b26\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/27\/2024052714092014699.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c\u63d2\u56fe\" \/><\/p>\n<h2>Visual Studio Code \u4e2d\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c<\/h2>\n<p>Visual Studio Code (VSCode) \u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c\u3002<\/p>\n<h3>\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c<\/h3>\n<ol>\n<li> <strong>\u6253\u5f00\u7528\u6237\u6216\u5de5\u4f5c\u533a\u8bbe\u7f6e\uff1a<\/strong>\u6309 Ctrl + , (Cmd + , \u9002\u7528\u4e8e Mac) \u6253\u5f00\u201c\u8bbe\u7f6e\u201d\u7a97\u53e3\u3002<\/li>\n<li> <strong>\u641c\u7d22\u201cSpaces\u201d\uff1a<\/strong>\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cSpaces\u201d\u3002<\/li>\n<li>\n<p><strong>\u9009\u62e9\u9996\u9009\u8bbe\u7f6e\uff1a<\/strong>\u6709\u591a\u4e2a\u9009\u9879\u53ef\u4f9b\u9009\u62e9\uff1a<\/p>\n<ul>\n<li> <strong>Tab Size\uff1a<\/strong>\u8bbe\u7f6e\u4e00\u4e2a tab \u952e\u8868\u793a\u7684\u7a7a\u683c\u6570\u3002<\/li>\n<li> <strong>Insert Spaces\uff1a<\/strong>\u9009\u4e2d\u540e\uff0c\u6309 Tab \u952e\u63d2\u5165\u7a7a\u683c\uff0c\u800c\u975e\u5236\u8868\u7b26\u3002<\/li>\n<li> <strong>Trim Trailing Whitespace\uff1a<\/strong>\u4fdd\u5b58\u65f6\u81ea\u52a8\u5220\u9664\u6587\u4ef6\u5c3e\u90e8\u7684\u7a7a\u767d\u5b57\u7b26\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u8be6\u7ec6\u8bbe\u7f6e<\/h3>\n<p><strong>Tab Size\uff1a<\/strong><\/p>\n<p>\u6b64\u8bbe\u7f6e\u6307\u5b9a\u4e00\u4e2a tab \u952e\u8868\u793a\u7684\u7a7a\u683c\u6570\u3002\u9ed8\u8ba4\u503c\u4e3a 4\u3002\u53ef\u4ee5\u901a\u8fc7\u66f4\u6539\u6b64\u503c\u6765\u5339\u914d\u9879\u76ee\u6216\u504f\u597d\u7684\u7f29\u8fdb\u6837\u5f0f\u3002<\/p>\n<p><strong>Insert Spaces\uff1a<\/strong><\/p>\n<p>\u5f53\u9009\u4e2d\u65f6\uff0c\u6309 Tab \u952e\u4f1a\u63d2\u5165\u7a7a\u683c\uff0c\u800c\u4e0d\u662f\u5236\u8868\u7b26\u3002\u5236\u8868\u7b26\u53ef\u80fd\u5bfc\u81f4\u5e03\u5c40\u95ee\u9898\uff0c\u5c24\u5176\u662f\u4e0e\u5176\u4ed6\u4ee3\u7801\u7f16\u8f91\u5668\u4ea4\u6362\u6587\u4ef6\u65f6\u3002\u9009\u62e9\u6b64\u9009\u9879\u4ee5\u786e\u4fdd\u4e00\u81f4\u7684\u7f29\u8fdb\u3002<\/p>\n<p><strong>Trim Trailing Whitespace\uff1a<\/strong><\/p>\n<p>\u5f53\u9009\u4e2d\u65f6\uff0c\u4fdd\u5b58\u6587\u4ef6\u65f6\uff0cVSCode \u5c06\u81ea\u52a8\u5220\u9664\u6587\u4ef6\u5c3e\u90e8\u7684\u6240\u6709\u7a7a\u767d\u5b57\u7b26\uff08\u7a7a\u683c\u3001\u5236\u8868\u7b26\u548c\u6362\u884c\u7b26\uff09\u3002\u8fd9\u6709\u52a9\u4e8e\u4fdd\u6301\u4ee3\u7801\u6574\u6d01\u548c\u7b80\u6d01\u3002<\/p>\n<h3>\u793a\u4f8b\u8bbe\u7f6e<\/h3>\n<p>\u4ee5\u4e0b\u793a\u4f8b\u8bbe\u7f6e\u5c06 Tab Size \u8bbe\u7f6e\u4e3a 2\uff0c\u63d2\u5165\u7a7a\u683c\u5e76\u4fee\u526a\u5c3e\u968f\u7a7a\u767d\uff1a<\/p>\n<pre>{\n  \"editor.tabSize\": 2,\n  \"editor.insertSpaces\": true,\n  \"files.trimTrailingWhitespace\": true\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u901a\u8fc7\u8c03\u6574\u8fd9\u4e9b\u8bbe\u7f6e\uff0c\u60a8\u53ef\u4ee5\u81ea\u5b9a\u4e49 VSCode \u4ee5\u6ee1\u8db3\u60a8\u7684\u7f29\u8fdb\u548c\u4ee3\u7801\u683c\u5f0f\u504f\u597d\uff0c\u4ece\u800c\u63d0\u5347\u7f16\u7801\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vscode \u4e2d\u53ef\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c\uff0c\u5305\u62ec\uff1a\u2460 tab size\uff1a\u8bbe\u5b9a\u4e00\u4e2a tab \u952e\u8868\u793a\u7684\u7a7a\u683c\u6570\uff1b\u2461 insert spaces\uff1a\u6309 tab \u952e\u63d2\u5165\u7a7a\u683c\uff0c\u800c\u975e\u5236\u8868\u7b26\uff1b\u2462 trim trailing whitespace\uff1a\u4fdd\u5b58\u65f6\u81ea\u52a8\u5220\u9664\u6587\u4ef6\u5c3e\u90e8\u7a7a\u767d\u5b57\u7b26\u3002 Visual Studio Code \u4e2d\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c Visual Studio Code (VSCode) \u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u8bbe\u7f6e\u524d\u540e\u7a7a\u683c\u3002 \u8bbe\u7f6e\u524d\u540e\u7a7a\u683c \u6253\u5f00\u7528\u6237\u6216\u5de5\u4f5c\u533a\u8bbe\u7f6e\uff1a\u6309 Ctrl + , (Cmd + , \u9002\u7528\u4e8e Mac) \u6253\u5f00\u201c\u8bbe\u7f6e\u201d\u7a97\u53e3\u3002 \u641c\u7d22\u201cSpaces\u201d\uff1a\u5728\u641c\u7d22\u680f\u4e2d\u8f93\u5165\u201cSpaces\u201d\u3002 \u9009\u62e9\u9996\u9009\u8bbe\u7f6e\uff1a\u6709\u591a\u4e2a\u9009\u9879\u53ef\u4f9b\u9009\u62e9\uff1a Tab Size\uff1a\u8bbe\u7f6e\u4e00\u4e2a tab \u952e\u8868\u793a\u7684\u7a7a\u683c\u6570\u3002 Insert Spaces\uff1a\u9009\u4e2d\u540e\uff0c\u6309 Tab \u952e\u63d2\u5165\u7a7a\u683c\uff0c\u800c\u975e\u5236\u8868\u7b26\u3002 Trim Trailing Whitespace\uff1a\u4fdd\u5b58\u65f6\u81ea\u52a8\u5220\u9664\u6587\u4ef6\u5c3e\u90e8\u7684\u7a7a\u767d\u5b57\u7b26\u3002 \u8be6\u7ec6\u8bbe\u7f6e Tab Size\uff1a \u6b64\u8bbe\u7f6e\u6307\u5b9a\u4e00\u4e2a tab \u952e\u8868\u793a\u7684\u7a7a\u683c\u6570\u3002\u9ed8\u8ba4\u503c\u4e3a 4\u3002\u53ef\u4ee5\u901a\u8fc7\u66f4\u6539\u6b64\u503c\u6765\u5339\u914d\u9879\u76ee\u6216\u504f\u597d\u7684\u7f29\u8fdb\u6837\u5f0f\u3002 Insert Spaces\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-21393","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=21393"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21393\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}