{"id":176024,"date":"2020-04-18T08:11:35","date_gmt":"2020-04-18T00:11:35","guid":{"rendered":"https:\/\/gulass.cn\/?p=176024"},"modified":"2020-04-02T19:12:34","modified_gmt":"2020-04-02T11:12:34","slug":"programmer-vim-plugin","status":"publish","type":"post","link":"https:\/\/gulass.cn\/programmer-vim-plugin.html","title":{"rendered":"\u4f60\u4e0d\u5f97\u4e0d\u77e5\u9053\u7684\u9002\u7528\u4e8e\u7a0b\u5e8f\u5458\u7684VIM\u63d2\u4ef6"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u4ecb\u7ecd\u6700\u5e38\u7528\u548c\u6700\u53d7\u6b22\u8fce\u7684Vim\u63d2\u4ef6\u4e4b\u524d\uff0c\u8ba9\u6211\u4eec\u9996\u5148\u4e86\u89e3Vim\u7684\u771f\u6b63\u542b\u4e49\u3002\u57fa\u672c\u4e0a\uff0cVim\u53ea\u662f\u53e6\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u7f16\u5199\u548c\u7f16\u8f91\u6587\u672c\uff0c\u5c31\u50cf\u901a\u5e38\u5728Windows\u6216Mac\u4e0a\u4f7f\u7528\u7684Sublime Text\uff0c\u751a\u81f3\u5728Windows\u4e0a\u4f7f\u7528\u7684\u8bb0\u4e8b\u672c\u4e00\u6837\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Vim\u5141\u8bb8\u9ad8\u6548\u7684\u6587\u672c\u7f16\u8f91\uff0c\u6709\u65f6\u5b83\u751a\u81f3\u88ab\u89c6\u4e3a\u7a0b\u5e8f\u5458\u7684\u5b8c\u6574IDE\u3002\u4e3a\u8f6f\u4ef6\u5de5\u7a0b\u5e08\u7f16\u8f91\u73b0\u6709\u4ee3\u7801\u975e\u5e38\u8017\u65f6\u4e14\u5355\u8c03\u3002\u7531\u4e8eVim\u4e0e\u6548\u7387\u6709\u5173\uff0c\u56e0\u6b64\u5b83\u4f7f\u6211\u4eec\u80fd\u591f\u4f7f\u7528\u73b0\u6709\u7684\u5feb\u6377\u952e\u6765\u5904\u7406\u91cd\u590d\u7684\u4efb\u52a1\uff0c\u751a\u81f3\u53ef\u4ee5\u81ea\u5b9a\u4e49\u548c\u521b\u5efa\u81ea\u5df1\u7684\u952e\u76d8\u3002<\/p>\n

\"\"<\/p>\n

\u6d41\u884c\u7684Vim\u63d2\u4ef6<\/strong><\/div>\n

Vim\u662f\u6700\u53e4\u8001\u7684\u6587\u672c\u7f16\u8f91\u5668\u4e4b\u4e00\uff0c\u4f46\u5b83\u4ecd\u7136\u5f88\u5f3a\u5927\u3002\u6210\u719f\uff0c\u7a33\u5b9a\u548c\u53ef\u6269\u5c55\uff0c\u5177\u6709\u5927\u91cf\u63d2\u4ef6\uff0c\u53ef\u5728\u6574\u4e2a\u7f51\u7edc\u4e2d\u8bbf\u95ee\u3002Vim\u63d2\u4ef6\u6240\u505a\u7684\u662f\u901a\u8fc7\u4f7f\u7528\u5b83\u6765\u589e\u5f3a\u6211\u4eec\u7684\u5de5\u4f5c\u6d41\u7a0b\u6765\u5e2e\u52a9\u6269\u5c55Vim\u7684\u529f\u80fd\u3002<\/p>\n

Vim\u63d2\u4ef6\u57fa\u672c\u4e0a\u662f\u5728\u7279\u5b9a\u76ee\u5f55\u7ed3\u6784\u4e2d\u5206\u5e03\u7684\u5927\u91cfVimScript\u8bb0\u5f55\u3002Vim\u63d2\u4ef6\u5728\u63d2\u4ef6\u7ba1\u7406\u5668\u5728\u51fa\u540d\u4e4b\u524d\u88ab\u4f5c\u4e3atarball\u5305\u5f62\u5f0f\u5206\u53d1\u7684\u3002Vim\u63d2\u4ef6\u5728Vim\u4e2d\u5408\u5e76\u4e86\u5176\u4ed6\u529f\u80fd-\u8fd9\u4e9b\u4e0d\u662f\u7f16\u8f91\u5668\u56fa\u6709\u7684\u529f\u80fd\u3002\u7531\u4e8eVim\u7684\u5b58\u5728\uff0c\u53ef\u4ee5\u4f7f\u7528\u5404\u79cd\u5404\u6837\u7684\u63d2\u4ef6\u6765\u5b9e\u73b0\u5e7f\u6cdb\u7684\u7528\u9014\u3002\u8bf4\u5b9e\u8bdd\uff0c\u63d2\u4ef6\u4e5f\u8bb8\u662fVim\u6700\u57fa\u672c\u7684\u76ee\u7684\u3002<\/p>\n

Vim Rainbow<\/strong><\/span><\/div>\n

\"\"<\/p>\n

\u51e0\u4e4e\u6240\u6709\u4e3b\u8981\u7684\u7f16\u7a0b\u8bed\u8a00\u90fd\u4f7f\u65b9\u62ec\u53f7\u6765\u5b9e\u73b0\u4e0d\u540c\u7684\u610f\u56fe\u548c\u76ee\u7684 \u2013 \u65b9\u62ec\u53f7\uff0c\u5706\u62ec\u53f7\u548c\u82b1\u62ec\u53f7\u3002 \u901a\u5e38\uff0c\u5b83\u4eec\u4f1a\u5d4c\u5957\u4f7f\u7528\u591a\u5bf9\u62ec\u53f7\uff0c\u56e0\u6b64\u5f88\u96be\u641e\u6e05\u695a\u67d0\u4e2a\u62ec\u53f7\u7684\u5f00\u95ed\u533a\u95f4\u3002\u6211\u53d1\u73b0\u81ea\u5df1\u7ecf\u5e38\u8981\u6570\u5c0f\u62ec\u53f7\uff0c\u5c24\u5176\u662f\u5728\u590d\u6742\u7684 Bash \u811a\u672c\u4e2d\uff0c\u4ee5\u786e\u4fdd\u65e0\u8bef\u3002<\/p>\n

\u9ad8\u7ea7\u914d\u7f6e<\/strong><\/p>\n

\u73b0\u5728\u597d\u4e86\uff0cVim Rainbow\u63d2\u4ef6\u6765\u4e86\uff0c\u56e0\u4e3a\u5b83\u4e3a\u6bcf\u5bf9\u62ec\u53f7\u8bbe\u7f6e\u4e86\u4e0d\u540c\u7684\u989c\u8272\uff0c\u4ece\u800c\u4f7f\u5176\u5f88\u5bb9\u6613\u522b\u51fa\u54ea\u4e9b\u62ec\u53f7\u662f\u4e00\u5bf9\u62ec\u53f7\u3002 \u4e5f\u975e\u5e38\u6709\u7528\u800c\u4e14\u975e\u5e38\u751f\u52a8\u3002<\/p>\n

\u9ad8\u7ea7\u914d\u7f6e\u5141\u8bb8\u60a8\u5b9a\u4e49\u4e3a\u6bcf\u79cd\u7c7b\u578b\u7684\u6587\u4ef6\u4f7f\u7528\u4ec0\u4e48\u62ec\u53f7\u3002\u60a8\u8fd8\u53ef\u4ee5\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\u786e\u5b9a\u62ec\u53f7\u7684\u989c\u8272\u3002<\/p>\n

\u4f8b\u5982\uff0c\u4e0b\u9762\u4e00\u4e2a\u9ad8\u7ea7\u914d\u7f6e(\u5c06\u8fd9\u4e9b\u8bed\u53e5\u6dfb\u52a0\u5230\u4f60\u7684.vimrc\u4e2d):<\/p>\n

\r\nlet g:rainbow_active = 1\r\n\r\nlet g:rainbow_load_separately = [\r\n    \\ [ '*' , [['(', ')'], ['\\[', '\\]'], ['{', '}']] ],\r\n    \\ [ '*.tex' , [['(', ')'], ['\\[', '\\]']] ],\r\n    \\ [ '*.cpp' , [['(', ')'], ['\\[', '\\]'], ['{', '}']] ],\r\n    \\ [ '*.{html,htm}' , [['(', ')'], ['\\[', '\\]'], ['{', '}'], ['<\\a[^>]*>', '<\/[^>]*>']] ],\r\n    \\ ]\r\n\r\nlet g:rainbow_guifgs = ['RoyalBlue3', 'DarkOrange3', 'DarkOrchid3', 'FireBrick']\r\nlet g:rainbow_ctermfgs = ['lightblue', 'lightgreen', 'yellow', 'red', 'magenta']\r\n<\/pre>\n
Nerd-tree<\/strong><\/span><\/div>\n

\"\"<\/p>\n

\u53d7\u6b22\u8fce\u7684\u5e7f\u6cdb\u4f7f\u7528\u7684Vim\u63d2\u4ef6\u4e4b\u4e00\u662fNerd-tree\u3002 NERDTree\u662fVim\u7f16\u8f91\u5668\u7684\u6587\u4ef6\u7cfb\u7edf\u6d4f\u89c8\u5668\u3002 \u4f7f\u7528\u6b64\u63d2\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u76f4\u89c2\u5730\u6d4f\u89c8\u590d\u6742\u7684\u76ee\u5f55\u5c42\u6b21\u7ed3\u6784\uff0c\u5feb\u901f\u6253\u5f00\u6587\u4ef6\u4ee5\u8fdb\u884c\u8bfb\u53d6\u6216\u7f16\u8f91\uff0c\u4ee5\u53ca\u6267\u884c\u57fa\u672c\u7684\u6587\u4ef6\u7cfb\u7edf\u64cd\u4f5c\u3002<\/p>\n

\u8fd9\u5728\u4e3a\u5927\u578b\u4f01\u4e1a\u6216\u9879\u76ee\u5de5\u4f5c\u65f6\u6548\u679c\u6700\u4f73\uff0c\u56e0\u4e3a\u5f88\u96be\u627e\u5230\u5305\u542b\u60a8\u8981\u66f4\u6539\u7684\u4e00\u884c\u5185\u5bb9\u7684\u4e00\u4e2a\u6587\u6863\u7684\u540d\u79f0\u548c\u533a\u57df\u3002 \u56e0\u6b64\uff0c\u4f7f\u7528\u6b64\u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6267\u884c\u57fa\u672c\u7684\u6587\u4ef6\u7cfb\u7edf\u64cd\u4f5c\uff0c\u8f7b\u677e\u6d4f\u89c8\u91cd\u8981\u7684\u590d\u6742\u76ee\u5f55\u94fe\uff0c\u751a\u81f3\u53ef\u4ee5\u901a\u8fc7\u5feb\u901f\u6253\u5f00\u8fd9\u4e9b\u8bb0\u5f55\u5728\u4efb\u4f55\u9700\u8981\u7684\u5730\u65b9\u9605\u8bfb\u548c\u4fee\u6539\u6587\u6863\u3002<\/p>\n

\u8f7b\u5feb\u7684\u6309\u952e\u64cd\u4f5c\u5c06\u4ee5\u5782\u76f4\u7684\u65b9\u5f0f\u6253\u5f00\u6d4f\u89c8\u5668\u7a97\u53e3\uff0c\u60a8\u65e0\u9700\u82b1\u592a\u591a\u65f6\u95f4\u5c31\u53ef\u4ee5\u6d4f\u89c8\u6240\u9700\u7684\u8bb0\u5f55\u5e76\u6253\u5f00\u5b83\u3002 \u5bf9\u4e8e\u5927\u91cf\u7684\u4ee3\u7801\u5206\u7c7b\u6765\u8bf4\uff0c\u8fd9\u662f\u7edd\u5bf9\u5fc5\u8981\u7684\u3002 \u5bf9\u4e8e\u90a3\u4e9b\u96be\u4ee5\u8bb0\u4f4f\u6587\u4ef6\u540d\u7684\u4e2a\u4eba\uff0c\u540c\u6837\u4e5f\u662f\u5982\u6b64\u3002<\/p>\n

\u5982\u679c\u4f60\u5e0c\u671b\u5728Vim\u542f\u52a8\u65f6\u81ea\u52a8\u6253\u5f00NERDTree\uff1f\u5c06\u4ee5\u4e0b\u4ee3\u7801\u7c98\u8d34\u5230\u60a8\u7684vimrc\u4e2d\uff1a<\/p>\n

\r\nautocmd StdinReadPre * let s:std_in=1\r\nautocmd VimEnter * if argc() == 0 && !exists(\"s:std_in\") | NERDTree | endif<\/pre>\n
Ack<\/strong><\/span><\/div>\n

\"\"<\/p>\n

Ack\u662f\u5168\u4e16\u754c\u7a0b\u5e8f\u5458\u666e\u904d\u4f7f\u7528\u7684Vim\u63d2\u4ef6\u4e4b\u4e00\u3002 \u8fd9\u4e2a\u7279\u5b9a\u7684\u63d2\u4ef6\u5728Vim\u7f16\u7801\u65f6\u57fa\u672c\u4e0a\u5145\u5f53\u7a0b\u5e8f\u5458\u7684\u641c\u7d22\u5de5\u5177\u3002 \u6211\u4eec\u65f6\u4e0d\u65f6\u5730\u8981\u641c\u7d22\u5305\u542b\u7279\u5b9a\u884c\u751a\u81f3\u53ea\u662f\u4e00\u4e2a\u5355\u8bcd\u7684\u7279\u5b9a\u6587\u4ef6\uff0c\u800cack\u6b63\u662f\u9002\u5408Vim\u7528\u6237\u7684\u63d2\u4ef6\u3002<\/p>\n

\u5b83\u4e0d\u4ec5\u4f7f\u6211\u4eec\u53ef\u4ee5\u5728Vim\u4e2d\u641c\u7d22\u6587\u4ef6\uff0c\u800c\u4e14\u8fd8\u53ef\u4ee5\u5728\u5355\u72ec\u7684\u5206\u5272\u7a97\u53e3\u4e2d\u663e\u793a\u7ed3\u679c\uff0c\u4ee5\u4fbf\u6211\u4eec\u6539\u5584\u3002 \u6700\u91cd\u8981\u7684\u662f\uff0c\u5b83\u8fd8\u663e\u793a\u4e8b\u4ef6\u7684\u884c\u53f7\uff0c\u6bcf\u4e2a\u4e8b\u4ef6\u4e00\u6b21\u3002<\/p>\n

\u5e2e\u52a9\u547d\u4ee4\uff1a<\/p>\n

:help Ack<\/pre>\n
\u603b\u7ed3<\/strong><\/div>\n

\u672c\u6587\u5148\u4ecb\u7ecd3\u4e2a\u5427\uff0cVim\u63d2\u4ef6\u7684\u8d85\u7a33\u5b9a\u7279\u6027\u53ef\u80fd\u662fVim\u63d2\u4ef6\u7279\u6027\u4e2d\u6700\u597d\u7684\u90e8\u5206\u3002\u968f\u7740\u6bcf\u9694\u4e00\u5929\u5c31\u6709\u4e00\u4e2a\u65b0\u63d2\u4ef6\u53d1\u5e03\uff0c\u60a8\u53ef\u4ee5\u6781\u5927\u5730\u6539\u5584\u4f7f\u7528Vim\u7684\u4f53\u9a8c\u3002vim\u63d2\u4ef6\u4e0d\u4ec5\u7b80\u5316\u4e86\u6211\u4eec\u5728vim\u4e0a\u7684\u5de5\u4f5c\uff0c\u800c\u4e14\u4f7f\u4e8b\u60c5\u53d8\u5f97\u975e\u5e38\u6709\u8da3\u548c\u5438\u5f15\u4eba\u3002<\/p>\n

\u8fd9\u4e9b\u53ea\u662f\u6211\u4eec\u7cbe\u9009\u7684\u5404\u79cdVim\u63d2\u4ef6\u4e2d\u7684\u4e00\u5c0f\u90e8\u5206\u3002 \u6211\u4eec\u5e0c\u671b\u5b83\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\u3002 \u8bf7\u4e0d\u8981\u5fd8\u8bb0\u5206\u4eab\u6211\u4eec\u7684\u6587\u7ae0\uff0c\u5e76\u5e2e\u52a9\u5176\u4ed6\u4eba\u4e86\u89e3\u8fd9\u4e00\u77e5\u8bc6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Vim\u5141\u8bb8\u9ad8\u6548\u7684\u6587\u672c\u7f16\u8f91\uff0c\u6709\u65f6\u5b83\u751a\u81f3\u88ab\u89c6\u4e3a\u7a0b\u5e8f\u5458\u7684\u5b8c\u6574IDE\u3002\u4e3a\u8f6f\u4ef6\u5de5\u7a0b\u5e08\u7f16\u8f91\u73b0\u6709\u4ee3\u7801\u975e\u5e38\u8017\u65f6\u4e14\u5355\u8c03\u3002\u7531\u4e8eVi […]<\/p>\n","protected":false},"author":317,"featured_media":115658,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-176024","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\/176024","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\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=176024"}],"version-history":[{"count":2,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/176024\/revisions"}],"predecessor-version":[{"id":176030,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/176024\/revisions\/176030"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/115658"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=176024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=176024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=176024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}