{"id":176235,"date":"2020-04-20T08:39:16","date_gmt":"2020-04-20T00:39:16","guid":{"rendered":"https:\/\/gulass.cn\/?p=176235"},"modified":"2020-04-07T09:41:29","modified_gmt":"2020-04-07T01:41:29","slug":"vim-lifting-skills","status":"publish","type":"post","link":"https:\/\/gulass.cn\/vim-lifting-skills.html","title":{"rendered":"Vim\u63d0\u5347\u6280\u5de7"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nVim \u662f\u6700\u53d7\u6b22\u8fce\u7684\u6587\u672c\u7f16\u8f91\u5668\u4e4b\u4e00\uff0c\u56e0\u6b64\u7edd\u5bf9\u503c\u5f97\u4f60\u82b1\u65f6\u95f4\u53bb\u5b66\u4e60\u5982\u4f55\u4f7f\u7528\u5b83\u3002\u5c31\u7b97\u4f60\u53ea\u662f\u5b66\u4e60\u4f7f\u7528\u8fd9\u4e2a\u65e0\u5904\u4e0d\u5728\u7684 Vi(m) \u547d\u4ee4\u884c\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u6587\u4ef6\u3001\u8f93\u5165\u548c\u7f16\u8f91\u4e00\u4e9b\u6587\u672c\u3001\u4fdd\u5b58\u7f16\u8f91\u7684\u6587\u4ef6\u5e76\u9000\u51fa\u7a0b\u5e8f\uff0c\u4f60\u90fd\u4f1a\u53d7\u76ca\u532a\u6d45\u3002
\n<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u4f60\u4f1a\u53d1\u73b0\uff0c\u4f7f\u7528 Vim \u975e\u5e38\u65b9\u4fbf\u7684\u7684\u573a\u666f\u51e0\u4e4e\u603b\u662f\u6d89\u53ca\u5230\u8fd0\u884c\u8fdc\u7a0b Shell \u64cd\u4f5c\u7684\u4efb\u52a1\u3002\u5982\u679c\u4f60\u65f6\u4e0d\u65f6\u5730\u4f7f\u7528 ssh\uff0c\u6bd4\u5982\uff1a<\/p>\n

$ ssh user@hostname.provider.com<\/pre>\n

\u5e76\u5728\u865a\u62df\u4e13\u7528\u670d\u52a1\u5668(VPS)\u6216\u672c\u5730\u865a\u62df\u5316\u5bb9\u5668\u4e2d\u5de5\u4f5c\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u4ece\u8fd9\u4e9b\u5f3a\u5927\u7684 Vim \u6280\u80fd\u4e2d\u53d7\u76ca\u532a\u6d45\u3002<\/p>\n

\u5c06 Vim \u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u7684\u6587\u672c\u7f16\u8f91\u5668<\/strong><\/div>\n

\u51e0\u4e4e\u6240\u6709\u7684\u73b0\u4ee3 Linux(\u6216 BSD)\u53d1\u884c\u7248\u4e2d\uff0c\u90fd\u53ef\u4ee5\u5728\u7ec8\u7aef\u4eff\u771f\u5668\u7684 shell \u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\u4f7f\u7528 Vim\u3002\u4e00\u65e6\u5728\u4f60\u7684\u7528\u6237 shell \u7a0b\u5e8f\u4e2d\u5c06 Vim \u5b9a\u4e49\u4e3a\u9ed8\u8ba4\u7f16\u8f91\u5668\u540e\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u4f7f\u7528\u719f\u6089\u7684 Vim \u952e\u7ed1\u5b9a\u6765\u5728\u5185\u7f6e\u7684\u5b9e\u7528\u7a0b\u5e8f(\u4f8b\u5982 man)\u4e2d\u5bfc\u822a\u3002\u6211\u5c06\u8bf4\u660e\u5982\u4f55\u4f7f\u7528 Bash \u548c Z shell(zsh)\u6765\u5b9e\u73b0\u6b64\u76ee\u7684\uff0czsh \u73b0\u5728\u662f macOS \u7528\u6237\u7684\u9ed8\u8ba4 shell(\u81ea Catalina \u8d77)\u3002<\/p>\n

(1) \u5728 Bash \u4e2d\u5c06 Vim \u8bbe\u7f6e\u4e3a\u9ed8\u8ba4<\/strong><\/span><\/div>\n

Bash \u901a\u8fc7\u70b9\u6587\u4ef6\u7684\u7ec4\u5408\u6765\u7ba1\u7406\u8bbe\u7f6e\u3002\u6700\u5e38\u89c1\u7684\u7684\u505a\u6cd5\u5c06\u4f60\u7684\u7f16\u8f91\u5668\u6dfb\u52a0\u5230\u4e3b\u76ee\u5f55\u4e2d\u7684 .bashrc \u6587\u4ef6\u4e2d\uff0c\u4f46\u4e5f\u53ef\u4ee5\u5c06\u5176\u6dfb\u52a0\u5230 .bash_profile \u4e2d\u3002(\u8bf7\u9605\u8bfb GNU Bash \u6587\u6863 \u4e86\u89e3\u4e24\u8005\u7684\u4e0d\u540c\u4e4b\u5904)\u3002<\/p>\n

\u901a\u8fc7\u5728 ~\/.bashrc \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff0c\u5c06 Vim \u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u7f16\u8f91\u5668\uff1a<\/p>\n

# set default editor to Vim \r\nexport EDITOR=vim<\/pre>\n

\u4ee5 # \u5f00\u5934\u7684\u884c\u662f\u53ef\u9009\u7684\u6ce8\u91ca\uff0c\u8fd9\u662f\u4e00\u4e2a\u597d\u65b9\u6cd5\uff0c\u53ef\u4ee5\u63d0\u9192\u81ea\u5df1\u8be5\u547d\u4ee4\u7684\u4f5c\u7528\u3002<\/p>\n

(2) \u5728 zsh \u4e2d\u5c06 Vim \u8bbe\u7f6e\u4e3a\u9ed8\u8ba4<\/strong><\/span><\/div>\n

zsh \u662f\u4e00\u79cd\u8d8a\u6765\u8d8a\u6d41\u884c\u7684\u7ec8\u7aef\u4eff\u771f\u5668\uff0c\u5c24\u5176\u662f\u5728\u82f9\u679c\u516c\u53f8\u7684\u57fa\u4e8e FreeBSD \u7684 Darwin \u7cfb\u7edf\u6700\u8fd1\u4ece Bash \u8f6c\u5411 zsh \u4ee5\u6765\u3002<\/p>\n

zsh \u70b9\u6587\u4ef6\u4e0e Bash \u7684\u6587\u4ef6\u76f8\u5f53\uff0c\u56e0\u6b64\u4f60\u53ef\u4ee5\u5728 ~\/.zshrc \u6216 ~\/.zprofile \u4e4b\u95f4\u8fdb\u884c\u9009\u62e9\u3002\u6709\u5173\u4f55\u65f6\u4f7f\u7528\u54ea\u4e00\u4e2a\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 zsh\u6587\u6863 \u3002<\/p>\n

\u5c06\u5176\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\uff1a<\/p>\n

# set default editor to Vim \r\nexport EDITOR=vim<\/pre>\n
\u4f18\u5316 Vim \u914d\u7f6e<\/strong><\/div>\n

Vim \u50cf\u662f\u7ec8\u7aef\u4eff\u771f\u5668 shell \u4e00\u6837\uff0c\u4e5f\u4f7f\u7528\u70b9\u6587\u4ef6\u6765\u8bbe\u7f6e\u4e2a\u4eba\u504f\u597d\u3002\u5982\u679c\u4f60\u53d1\u73b0\u4e86\u8fd9\u79cd\u6a21\u5f0f\uff0c\u5219\u53ef\u80fd\u5df2\u7ecf\u731c\u5230\u5b83\u662f ~\/.vimrc\u3002<\/p>\n

\u4f60\u53ef\u80fd\u8981\u66f4\u6539\u7684\u7b2c\u4e00\u4e2a\u8bbe\u7f6e\u662f\u5c06\u5bf9\u4f20\u7edf\u7684 Vi \u517c\u5bb9\u6a21\u5f0f\u5207\u6362\u4e3a\u201c\u5173\u95ed\u201d\u3002\u7531\u4e8e Vim \u662f Vi \u7684\u8d85\u96c6\uff0c\u56e0\u6b64 Vi \u4e2d\u7684\u6240\u6709\u529f\u80fd\u5728 Vim \u4e2d\u90fd\u662f\u53ef\u7528\u7684\uff0c\u5e76\u4e14\u5728 Vim \u4e2d\u5f97\u5230\u4e86\u5f88\u5927\u7684\u6539\u8fdb\uff0c\u4f60\u53ef\u4ee5\u83b7\u5f97\u8bb8\u591a\u9ad8\u7ea7\u529f\u80fd\u3002\u6700\u65b0\u7248\u672c(8.2)\u5141\u8bb8\u4f60\u5728\u5206\u5272\u7684\u7a97\u53e3\u4e2d\u4ee5\u5b50\u8fdb\u7a0b shell \u7684\u65b9\u5f0f\u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\u3002<\/p>\n

\u987a\u4fbf\u8bf4\u4e00\u53e5\uff0c\u660e\u786e\u5173\u95ed\u5bf9\u4f20\u7edf\u7684 Vi \u7684\u517c\u5bb9\u6027\u770b\u8d77\u6765\u6ca1\u6709\u4ec0\u4e48\u4f5c\u7528( \u4e8b\u5b9e\u4e0a\uff0c\u53ef\u80fd\u5e76\u6ca1\u6709\u4ec0\u4e48\u4f5c\u7528 )\u3002\u5f53 Vim \u9047\u5230 .vimrc \u6587\u4ef6\u65f6\uff0c\u5b83\u4f1a\u6697\u6697\u5730\u81ea\u52a8\u5c06\u517c\u5bb9\u6a21\u5f0f\u5207\u6362\u5230\u5173\u95ed\u3002\u4f46\u6709\u65f6\u5c06\u5176\u660e\u786e\u5173\u95ed\u4ecd\u7136\u5f88\u91cd\u8981\u3002\u7f29\u5199 nocp \u662f nocompatible \u7684\u540c\u4e49\u8bcd\uff0c\u4f5c\u7528\u662f\u4e00\u6837\u7684\u3002 \u6761\u6761\u5927\u9053\u901a\u7f57\u9a6c \uff0c\u5207\u6362\u9996\u9009\u9879\u6709\u5f88\u591a\u65b9\u5f0f\u3002<\/p>\n

\u5728 .vimrc \u8bed\u6cd5\u4e2d\uff0c \u4ee5 \" \u5f00\u5934\u7684\u884c\u662f\u6ce8\u91ca(\u5c31\u50cf .bashrc \u6587\u4ef6\u4e2d\u7684 # \u4e00\u6837)\uff0c\u8fd9\u4e9b\u6ce8\u91ca\u53ef\u4ee5\u5e2e\u52a9\u4f60\u8bb0\u4f4f\u8bf8\u5982\u4e3a\u4f55\u9009\u62e9\u4e86\u4e00\u4e2a\u9690\u6666\u7684\u8bbe\u7f6e\u540d\u79f0\u4e4b\u7c7b\u7684\u5185\u5bb9\u3002<\/p>\n

\u8981\u5173\u95ed Vi \u517c\u5bb9\u6027\uff0c\u8bf7\u5c06\u4ee5\u4e0b\u5185\u5bb9\u6dfb\u52a0\u5230 ~\/.vimrc \u6587\u4ef6\u4e2d\uff1a<\/p>\n

\" ensure that legacy compatibility mode is off \r\n\" documentation: <http:\/\/vimdoc.sourceforge.net\/htmldoc\/options.html\\#'compatible>' \r\nset nocp\r\n<\/pre>\n
\u7406\u89e3\u6a21\u5f0f<\/strong><\/div>\n

Vim \u7684 \u201c\u6a21\u5f0f\u201d\u6982\u5ff5\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u5c24\u5176\u662f\u201c\u666e\u901a\u6a21\u5f0f\u201d\u548c\u201c\u63d2\u5165\u6a21\u5f0f\u201d\u4e4b\u95f4\u7684\u533a\u522b\u3002\u5bf9\u6a21\u5f0f\u7684\u6df7\u6dc6\u662f\u5927\u591a\u6570\u65b0\u7528\u6237\u7684\u56f0\u6270\u3002\u6a21\u5f0f\u5e76\u4e0d\u662f Vim \u6240\u72ec\u6709\u7684\uff0c\u751a\u81f3\u4e5f\u4e0d\u662f Vi \u6240\u5f15\u5165\u7684\u3002\u547d\u4ee4\u6a21\u5f0f\u662f\u5982\u6b64\u7684\u53e4\u8001\uff0c\u4ee5\u81f3\u4e8e\u5b83\u6bd4 70 \u5e74\u4ee3\u53d1\u660e\u7684 \u590d\u5236\u548c\u7c98\u8d34 \u529f\u80fd\u8fd8\u8981\u65e9\u3002<\/p>\n

Vim \u4f9d\u8d56\u4e8e\u4e0d\u540c\u7684\u6a21\u5f0f\u6765\u5b9a\u4e49\u952e\u76d8\u7684\u6572\u51fb\u884c\u4e3a\u3002\u9700\u8981\u4e86\u89e3\u7684\u91cd\u8981\u6a21\u5f0f\u6709\uff1a<\/p>\n

    \u666e\u901a\u6a21\u5f0f\uff1a\u9ed8\u8ba4\u6a21\u5f0f\uff0c\u4e3b\u8981\u7528\u4e8e\u5bfc\u822a\u548c\u6253\u5f00\u6587\u4ef6\u3002<\/ol>\n
      \u63d2\u5165\u6a21\u5f0f(\u5305\u62ec\u66ff\u6362)\uff1a\u8fd9\u79cd\u6a21\u5f0f\u4e0b Vim \u5141\u8bb8\u5c06\u6587\u672c\u8f93\u5165\u5230\u6253\u5f00\u7684\u6587\u4ef6\u4e2d\u3002<\/ol>\n
        \u53ef\u89c6\u6a21\u5f0f\uff1aVim \u7684\u884c\u4e3a\u7c7b\u4f3c\u4e8e\u57fa\u4e8e\u9f20\u6807\u7684\u8f93\u5165\u65b9\u5f0f\uff0c\u5982\u590d\u5236\u3001\u7f16\u8f91\u3001\u66ff\u6362\u7b49\u3002<\/ol>\n
          \u547d\u4ee4\u6a21\u5f0f(\u5305\u62ec\u884c\u6a21\u5f0f\u3001Ex \u547d\u4ee4\u6a21\u5f0f\u548c\u672b\u884c\u6a21\u5f0f)\uff1a\u662f\u5728 Vim \u4e2d\u505a\u66f4\u591a\u4e8b\u60c5\u7684\u5f3a\u5927\u65b9\u6cd5\u3002<\/ol>\n

          \u6bcf\u79cd\u6a21\u5f0f\u90fd\u6709\u5f88\u591a\u503c\u5f97\u63a2\u7d22\u7684\u5730\u65b9\u3002\u4f7f\u7528 Vimtutor (vimtutor)\u53ef\u4ee5\u4ea4\u4e92\u5f0f\u5730\u5b66\u4e60\u79fb\u52a8\u5149\u6807\u3001\u6a21\u5f0f\u548c\u5728\u672b\u884c\u6a21\u5f0f\u4e0b\u8fd0\u884c Ex \u547d\u4ee4\u3002\u4e00\u4e9b\u4e0d\u53ef\u7f3a\u5c11\u7684\u751f\u4ea7\u529b\u64cd\u4f5c\u7b26\u5305\u62ec\uff1a<\/p>\n

          \"\"<\/p>\n

          \u50cf\u94a2\u7434\u4e00\u6837\u5f39\u594f Vim<\/strong><\/div>\n

          \u5c3d\u7ba1\u628a Vim \u7684\u64cd\u4f5c\u7b26\u201c\u8bed\u8a00\u201d\u8bb0\u5728\u8bb0\u5fc6\u4e2d\u662f\u5f88\u91cd\u8981\u7684\uff0c\u4f46\u8981\u60f3\u638c\u63e1\u5b83\uff0c\u96be\u70b9\u5728\u4e8e\u5b66\u4f1a\u50cf\u97f3\u4e50\u5bb6\u4e00\u6837\u601d\u8003\uff0c\u628a\u64cd\u4f5c\u7b26\u548c\u52a8\u4f5c\u7ec4\u5408\u6210\u201c\u548c\u5f26\u201d\uff0c\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u50cf\u5f39\u94a2\u7434\u4e00\u6837\u5f39\u594f Vim\u3002\u8fd9\u5c31\u662f Vim \u7684\u6587\u672c\u64cd\u4f5c\u80fd\u529b\u53ef\u4ee5\u4e0e\u53e6\u4e00\u4e2a\u8457\u540d\u7684\u547d\u4ee4\u884c\u7f16\u8f91\u5668 Emacs \u76f8\u5ab2\u7f8e\u7684\u5730\u65b9\u3002(\u867d\u7136\u5176\u4e2d\u4e00\u4e2a\u7f16\u8f91\u5668\u4f1a\u8ba9\u78e8\u635f\u6389\u4f60\u7684 Esc \u952e\uff0c\u800c\u53e6\u4e00\u4e2a\u7f16\u8f91\u5668\u4f1a\u8ba9\u4f60\u7684 Ctrl \u952e\u78e8\u635f\u6389\u3002)<\/p>\n

          \u5728\u63cf\u8ff0\u952e\u201c\u548c\u5f26\u201d\u65f6\uff0cVim \u4e2d\u7684\u4f20\u7edf\u505a\u6cd5\u662f\u7528\u5927\u5199\u5b57\u6bcd C \u540e\u9762\u52a0\u4e0a\u4e00\u4e2a\u8fde\u5b57\u7b26(C-)\u6765\u6307\u4ee3 Ctrl \u952e\u3002\u8fd9\u5e76\u4e0d\u662f\u901a\u7528\u7684\uff0c\u4f46\u6211\u5c06\u4ece\u8fd9\u91cc\u5f00\u59cb\u9075\u5faa\u8fd9\u4e00\u60ef\u4f8b\uff0c\u5e76\u5728\u6709\u53ef\u80fd\u5f15\u8d77\u6df7\u6dc6\u7684\u65f6\u5019\u52a0\u4ee5\u8bf4\u660e\u3002<\/p>\n

          \u5982\u679c\u4f60\u5728 Vim \u4e2d\u952e\u5165\u957f\u884c\uff0c\u4f60\u4f1a\u60f3\u628a\u5b83\u8bbe\u7f6e\u6210\u53ef\u4ee5\u6362\u884c\u3002\u60f3\u8981\u6839\u636e\u4f60\u7684\u5de5\u4f5c\u65b9\u5f0f\u5bf9 Vim \u8fdb\u884c\u4e2a\u6027\u5316\u8bbe\u7f6e\uff0c\u8bf7\u8003\u8651\u4e00\u4e0b\u8fd9\u4e2a\u8bbe\u7f6e\uff1a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4f60\u5e0c\u671b Vim \u542f\u52a8\u65f6\u5982\u4f55\u5904\u7406\u6587\u672c\u6362\u884c?\u5f00\u8fd8\u662f\u5173?\u6211\u559c\u6b22\u5c06\u5176\u5173\u95ed\uff0c\u5e76\u5c06\u5176\u7559\u5728\u8fd0\u884c\u547d\u4ee4\u6587\u4ef6\u4e4b\u5916\u3002\u5f53\u6211\u60f3\u8ba9\u6587\u672c\u81ea\u52a8\u6362\u884c\u65f6\uff0c\u6211\u53ea\u9700\u5728\u547d\u4ee4\u884c\u6a21\u5f0f\u4e0b\u7528 :set wrap \u8bbe\u7f6e\u5373\u53ef\u3002<\/p>\n

          \u8ba9 Vim \u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u81ea\u52a8\u6362\u884c\u5e76\u6ca1\u6709\u9519\uff0c\u8fd9\u53ea\u662f\u4e00\u4e2a\u504f\u597d\u95ee\u9898 \u2014\u2014 \u5b83\u53ef\u80fd\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\u800c\u6539\u53d8\u3002\u540c\u6837\u4f60\u4e5f\u53ef\u4ee5\u63a7\u5236\u7c98\u8d34\u3001\u4ee3\u7801\u8bed\u8a00\u7f29\u8fdb\u8bed\u6cd5\u548c Tab \u952e\u7684\u8bbe\u7f6e(\u5236\u8868\u7b26\u8fd8\u662f\u7a7a\u683c?\u591a\u5c11\u4e2a\u7a7a\u683c?\u53ef\u4e5f\u5728 \u8fd9\u91cc \u6df1\u5165\u7814\u7a76\u8fd9\u4e9b\u9009\u9879)\u3002\u6240\u6709\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u7684\u9009\u9879\u90fd\u662f\u5b8c\u5168\u53ef\u914d\u7f6e\u548c\u53ef\u66f4\u6539\u7684\uff0c\u5e76\u4e14\u5728\u4f60\u4f7f\u7528\u547d\u4ee4\u884c\u6a21\u5f0f\u64cd\u4f5c\u65f6\u53ef\u4ee5\u5b9e\u65f6\u66f4\u6539\u3002<\/p>\n

          \u4f60\u4f1a\u5728\u793e\u533a\u8bba\u575b\u3001Vim \u7ef4\u57fa\u548c\u6587\u7ae0(\u6bd4\u5982\u8fd9\u7bc7\u6587\u7ae0)\u4e2d\u627e\u5230\u5f88\u591a\u5173\u4e8e\u8bbe\u7f6e Vim \u9ed8\u8ba4\u8bbe\u7f6e\u7684\u5efa\u8bae\u3002\u4f60\u5e94\u8be5\u5f88\u719f\u6089\u4e3a\u4f60\u7684\u4e2a\u4eba\u8ba1\u7b97\u73af\u5883\u8bbe\u7f6e\u9996\u9009\u9879\uff0cVim \u4e5f\u4e0d\u4f8b\u5916\u3002\u6211\u5f3a\u70c8\u5efa\u8bae\u4f60\u4ece\u5bf9\u8bbe\u7f6e\u8fdb\u884c\u5f88\u5c0f\u7684\u66f4\u6539\u5f00\u59cb\uff0c\u6162\u6162\u5730\u8fdb\u884c\u5176\u5b83\u66f4\u6539\uff0c\u4ee5\u4fbf\u4f60\u53ef\u4ee5\u8f7b\u677e\u5730\u6062\u590d\u8bbe\u7f6e\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u4f60\u5c31\u53ef\u4ee5\u597d\u591a\u5e74\u907f\u514d\u4f7f\u7528\u63d2\u4ef6\u6216\u5b8c\u5168\u4e0d\u7528\u63d2\u4ef6\u3002<\/p>\n

          Vim 8.2 \u4e2d\u7684\u5206\u5272\u3001\u6807\u7b7e\u548c\u7ec8\u7aef<\/strong><\/div>\n

          \u6709\u4e24\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5c06\u4f60\u6b63\u5728\u5904\u7406\u7684\u6587\u4ef6\u5206\u5272\u6210\u4e0d\u540c\u7684\u89c6\u56fe\uff1a\u5b83\u4eec\u53ef\u4ee5\u5e76\u6392\u663e\u793a\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5e94\u7528\u7a0b\u5e8f\u6807\u7b7e\u9875\u5728\u5168\u5c4f(\u7a97\u53e3)\u4e2d\u5207\u6362\u3002\u8fd9\u4e9b\u5bf9\u5e94\u7528\u7a0b\u5e8f\u7a97\u53e3\u7684\u66f4\u6539\u662f\u4ece\u547d\u4ee4\u6a21\u5f0f\u542f\u52a8\u7684\uff0c\u8fd9\u9700\u8981\u4f7f\u7528\u5192\u53f7(:)\u6765\u8c03\u8d77\u63d0\u793a\u7b26\u3002<\/p>\n

          \u6bcf\u4e2a\u5206\u5272\u7684\u7a97\u53e3\u53ef\u4ee5\u5bb9\u7eb3\u4e00\u4e2a\u6587\u4ef6\u8fdb\u884c\u7f16\u8f91\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6807\u7b7e\u9875\u5728\u66f4\u591a\u7684\u6587\u4ef6\u4e4b\u95f4\u968f\u610f\u5207\u6362\u3002\u5206\u5272\u7684\u5c4f\u5e55\u7a7a\u95f4\u6709\u9650\uff0c\u6240\u4ee5\u5f53\u4f60\u60f3\u5206\u5272\u66f4\u591a\u7684\u5c4f\u5e55\u65f6\uff0c\u6807\u7b7e\u9875\u662f\u5f88\u65b9\u4fbf\u7684\u3002\u60f3\u8981\u5982\u4f55\u8bbe\u7f6e\uff0c\u7eaf\u5c5e\u4e2a\u4eba\u559c\u597d\u7684\u95ee\u9898\u3002\u8981\u6c34\u5e73\u5206\u5272\u4e00\u4e2a\u7a97\u53e3\uff0c\u4f7f\u7528 :sp\uff0c\u5782\u76f4\u5206\u5272\u65f6\u4f7f\u7528 :vs\u3002<\/p>\n

          \u4ece Vim 8.2 \u5f00\u59cb\uff0c\u4f60\u53ef\u4ee5\u7528 :vert term \u6253\u5f00\u4e00\u4e2a\u5782\u76f4\u5206\u5272\u7684\u7ec8\u7aef shell \u5b50\u8fdb\u7a0b\uff0c\u4ee5\u5728\u4f60\u7684\u4ee3\u7801\u65c1\u8fb9\u7684\u547d\u4ee4\u884c\u4e0a\u8fdb\u884c\u64cd\u4f5c\u3002\u4f60\u9700\u8981\u952e\u5165 exit \u6765\u5173\u95ed\u4f60\u7684\u7ec8\u7aef\u8fdb\u7a0b\uff0c\u5c31\u50cf\u4f60\u7ed3\u675f\u4e00\u4e2a shell \u4f1a\u8bdd\u4e00\u6837\uff0c\u4f46\u4f60\u5173\u95ed\u8fd9\u4e2a\u5206\u5272\u7684\u7a97\u53e3\u548c\u6807\u7b7e\u9875\u7684\u65b9\u5f0f\u548c\u5173\u95ed\u4efb\u4f55\u666e\u901a\u7684 Vim \u7a97\u53e3\u4e00\u6837\uff0c\u8981\u7528 :q \u6765\u5173\u95ed\u3002<\/p>\n

          \u8981\u521d\u59cb\u5316\u4e00\u4e2a\u6807\u7b7e\u9875\uff0c\u8bf7\u4f7f\u7528\u4e00\u4e2a\u7279\u6b8a\u7684\u7f16\u8f91\u547d\u4ee4\uff1a:tabedit\uff0c\u5b83\u4f1a\u81ea\u52a8\u5207\u6362\u5230\u65b0\u6253\u5f00\u7684\u6807\u7b7e\u9875\u3002\u5982\u679c\u4f60\u7ed9\u8be5\u547d\u4ee4\u4e00\u4e2a\u6587\u4ef6\u540d\u4f5c\u4e3a\u53c2\u6570\uff0c\u4f1a\u6253\u5f00\u8be5\u6587\u4ef6\u5e76\u8fdb\u884c\u7f16\u8f91\u3002\u5982\u679c\u4f60\u5ffd\u7565\u4e86\u7ed9\u5b83\u4e00\u4e2a\u6587\u4ef6\u540d\u4f5c\u4e3a\u53c2\u6570\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u6a21\u5f0f\u4e0b\u7684\u4f7f\u7528\u7f16\u8f91\u547d\u4ee4 :e filename.txt\uff0c\u5c31\u50cf\u5728\u4efb\u4f55\u4e00\u4e2a\u666e\u901a\u7684 Vim \u7a97\u53e3\u4e2d\u4e00\u6837\u3002\u53ef\u4ee5\u4f7f\u7528\u4e0b\u4e00\u4e2a(:tabn)\u548c\u4e0a\u4e00\u4e2a(:tabp)\u547d\u4ee4\u5728\u6807\u7b7e\u9875\u95f4\u5bfc\u822a\u3002<\/p>\n

          \u8981\u4f7f\u7528\u5206\u5272\uff0c\u4f60\u9700\u8981\u77e5\u9053\u5982\u4f55\u4f7f\u7528\u7ec4\u5408\u952e C-w \u548c\u4f60\u60f3\u8981\u79fb\u52a8\u7684\u65b9\u5411\u7684\u79fb\u52a8\u952e\uff0c\u4f8b\u5982\u5de6(h)\u3001\u4e0b(j)\u3001\u5de6(k)\u3001\u53f3(l)\u3002\u5982\u679c\u4f60\u60f3\u5b66\u4e60\u66f4\u591a\u7684\u7ec4\u5408\u952e\uff0c\u8bf7\u9605\u8bfb Vim \u624b\u518c\u4e2d\u7684 :help split \u548c :help tabpage\u3002<\/p>\n

          \u83b7\u53d6\u5e2e\u52a9<\/strong><\/div>\n

          \u867d\u7136\u53ef\u4ee5\u5728 Vimtutor \u4e2d\u6253\u5f00\u53c2\u8003 Vim \u624b\u518c\uff0c\u4f46\u7528 :help \u6253\u5f00 Vim \u5e2e\u52a9\uff0c\u53ef\u4ee5\u8ba9\u4f60\u81ea\u5df1\u628a\u65f6\u95f4\u82b1\u5728\u7f16\u8f91\u5668\u4e0a\uff0c\u4e0d\u7528\u5b8c\u5168\u4f9d\u8d56\u50cf\u8fd9\u6837\u7684\u6587\u7ae0\uff0c\u5c31\u80fd\u83b7\u5f97\u66f4\u591a\u7684\u6210\u679c\u3002\u7ecf\u9a8c\u662f\u638c\u63e1 Vim \u7684\u5173\u952e\u3002\u7ecf\u9a8c\u6709\u52a9\u4e8e\u63d0\u9ad8\u4f60\u7684\u6574\u4f53\u8ba1\u7b97\u76f4\u89c9\uff0c\u56e0\u4e3a Vim \u4e2d\u7684\u5f88\u591a\u4e1c\u897f\u90fd\u662f\u4ece Unix \u5b87\u5b99\u4e2d\u6c72\u53d6\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

          \u4f60\u4f1a\u53d1\u73b0\uff0c\u4f7f\u7528 Vim \u975e\u5e38\u65b9\u4fbf\u7684\u7684\u573a\u666f\u51e0\u4e4e\u603b\u662f\u6d89\u53ca\u5230\u8fd0\u884c\u8fdc\u7a0b Shell \u64cd\u4f5c\u7684\u4efb\u52a1\u3002\u5982\u679c\u4f60\u65f6\u4e0d\u65f6\u5730\u4f7f\u7528 s […]<\/p>\n","protected":false},"author":1329,"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-176235","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\/176235","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\/1329"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=176235"}],"version-history":[{"count":3,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/176235\/revisions"}],"predecessor-version":[{"id":176243,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/176235\/revisions\/176243"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/176242"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=176235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=176235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=176235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}