\u662f\u5426\u53ef\u4ee5\u5b9e\u65f6\u67e5\u770b\u7acb\u5373\u683c\u5f0f\u5316\u7684\u4ee3\u7801\uff1f\u5982\u679c\u662f\u8fd9\u6837\uff0c\u90a3\u591a\u65b9\u4fbf\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/p>\n
Vim \u6709\u5f88\u591a\u4ee3\u7801\u683c\u5f0f\u5316\u63d2\u4ef6\uff0c\u6bd4\u5982auto-format\u548cneoformat\u3002\u4f46\u5b83\u4eec\u90fd\u9700\u8981\u8fd0\u884c\u67d0\u4e2a\u547d\u4ee4\u6216:w\u7528\u4e8e\u89e6\u53d1\u683c\u5f0f\u5316\u3002<\/p>\n
\u662f\u5426\u53ef\u4ee5\u5b9e\u65f6\u67e5\u770b\u7acb\u5373\u683c\u5f0f\u5316\u7684\u4ee3\u7801\uff1f\u5982\u679c\u662f\u8fd9\u6837\uff0c\u90a3\u591a\u65b9\u4fbf\u3002<\/p>\n
\u73b0\u5728\u597d\u4e86\uff0c\u6709\u4e00\u4e2a\u5c0f\u63d2\u4ef6vim-rt-format\uff0c\u5b83\u53ef\u4ee5\u5728\u6309\u4e0b ENTER \u540e\u7acb\u5373\u5728 INSERT \u6a21\u5f0f\u4e0b\u683c\u5f0f\u5316\u5f53\u524d\u884c\uff1a<\/p>\n
<\/p>\n
\u5f53\u4f60\u4e13\u6ce8\u4e8e\u7f16\u8f91\u65f6\uff0c\u4e00\u5207\u90fd\u662f\u5728\u4e0d\u9700\u8981\u989d\u5916\u6ce8\u610f\u7684\u60c5\u51b5\u4e0b\u5b8c\u6210\u7684\u3002\u65e0\u9700\u505c\u6b62\u60a8\u7684\u5de5\u4f5c\u6765\u8fd0\u884c\u989d\u5916\u7684\u547d\u4ee4\uff0c\u4f8b\u5982gq\u6216:Neoformat\u3002<\/p>\n
\u51c6\u5907\u597d\u8bd5\u8bd5\u4e86\u5417\uff1f\u9996\u5148\uff0c+python3\u5fc5\u987b\u5728\u60a8\u7684 vim \u4e2d\u542f\u7528\u529f\u80fd\uff0c\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u68c0\u67e5\uff1a<\/p>\n
\r\n:echo has('python3')\r\n<\/pre>\n\u5982\u679c\u60a8\u5f53\u524d\u7684 vim \u7248\u672c\u652f\u6301 python \uff0c\u5b83\u5c06\u8fd4\u56de1\u3002\u5982\u4e0b\u56fe\u3002<\/p>\n
\u5982\u679c\u6ca1\u6709\uff0c\u8bf7\u5b89\u88c5\u4e00\u4e2a\u5177\u6709+python3\u529f\u80fd\u7684\u65b0 vim \uff0c\u4f8b\u5982\u5728 ubuntu\/debian \u4e2d\uff1a<\/p>\n
\r\nlinuxmi@linuxmi:~\/www.linuxmi.com$ sudo apt-get install vim-nox<\/pre>\n\u5176\u6b21\uff0c\u9700\u8981\u4e00\u4e2a\u540d\u4e3a\u7684python\u6a21\u5757autopep8\uff1a<\/p>\n
linuxmi@linuxmi:~\/www.linuxmi.com$ sudo pip install autopep8<\/pre>\n\u7136\u540e\u5728\u60a8\u7684.vimrc\uff1a<\/p>\n
\r\n\" \u4f7f\u7528 vim-plug \u5b89\u88c5\u63d2\u4ef6\uff1a\r\nPlug 'skywind3000\/vim-rt-format'\r\n\" \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b83\u5c06\u5728\u63d2\u5165\u6a21\u5f0f\u4e0b\u7531\u201cENTER\u201d\u89e6\u53d1\u3002\r\n\" \u5c06\u6b64\u8bbe\u7f6e\u4e3a 1 \u4ee5\u4f7f\u7528`CTRL+ENTER`\uff0c\u5e76\u4fdd\u6301\r\n\" \u9ed8\u8ba4\u7684\u201cENTER\u201d\u884c\u4e3a\u4e0d\u53d8\u3002\r\nlet g:rtf_ctrl_enter = 0\r\n\" \u79bb\u5f00 INSERT \u6a21\u5f0f\u7684\u65f6\u5019\u518d\u683c\u5f0f\u5316\u4e00\u6b21\r\nlet g:rtf_on_insert_leave = 1<\/pre>\n\u4e3a\u5f53\u524d\u7f13\u51b2\u533a\u542f\u7528\u63d2\u4ef6\uff1a<\/p>\n
:RTFormatEnable<\/pre>\n\u4e00\u5207\u51c6\u5907\u5c31\u7eea\uff0c\u91cd\u65b0\u542f\u52a8 vim\uff0c\u7f16\u8f91\u4e00\u4e9b\u6587\u4ef6\uff0c\u7136\u540e\u60a8\u5c06\u5ea6\u8fc7\u7f8e\u597d\u7684\u4e00\u5929\u3002<\/p>\n
\u987a\u4fbf\u8bf4\u4e00\u53e5\uff1a\u76ee\u524d\uff0c\u5b83\u652f\u6301\u7684\u8bed\u8a00\u5305\u62ec Python\u3001Lua\u3001Ruby \u548c Javascript\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Vim \u6709\u5f88\u591a\u4ee3\u7801\u683c\u5f0f\u5316\u63d2\u4ef6\uff0c\u6bd4\u5982auto-format\u548cneoformat\u3002\u4f46\u5b83\u4eec\u90fd\u9700\u8981\u8fd0\u884c\u67d0\u4e2a\u547d\u4ee4\u6216:w\u7528 […]<\/p>\n","protected":false},"author":317,"featured_media":176242,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-237528","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=237528"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237528\/revisions"}],"predecessor-version":[{"id":237539,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/237528\/revisions\/237539"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/176242"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=237528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=237528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=237528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}