{"id":149,"date":"2024-06-19T21:45:51","date_gmt":"2024-06-19T13:45:51","guid":{"rendered":"https:\/\/www.swreader.com\/?p=149"},"modified":"2024-06-22T18:16:15","modified_gmt":"2024-06-22T10:16:15","slug":"%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/","title":{"rendered":"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357"},"content":{"rendered":"<p>Vim \u4f5c\u4e3a\u4e00\u6b3e\u9ad8\u5ea6\u53ef\u5b9a\u5236\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u5141\u8bb8\u7528\u6237\u901a\u8fc7\u7f16\u5199\u63d2\u4ef6\u6765\u6269\u5c55\u5176\u529f\u80fd\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u63d2\u4ef6\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u8fd9\u4e9b\u63d2\u4ef6\u3002<\/p>\n<h2>\u4ec0\u4e48\u662fVim\u63d2\u4ef6\uff1f<\/h2>\n<p>Vim\u63d2\u4ef6\u662f\u4e00\u7ec4\u811a\u672c\u6216\u7a0b\u5e8f\uff0c\u7528\u4e8e\u589e\u5f3a\u548c\u5b9a\u5236Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\u3002\u5b83\u4eec\u53ef\u4ee5\u5b9e\u73b0\u5404\u79cd\u4efb\u52a1\uff0c\u5982\u8bed\u6cd5\u9ad8\u4eae\u3001\u81ea\u52a8\u5b8c\u6210\u3001\u6587\u4ef6\u64cd\u4f5c\u3001\u96c6\u6210\u5916\u90e8\u5de5\u5177\u7b49\u3002<br \/>\n<a href=\"https:\/\/v.xbin.io\/static\/media\/vim-key-mapping-logo.053a8f62ac4db3d32bd2.png\"><img decoding=\"async\" src=\"https:\/\/v.xbin.io\/static\/media\/vim-key-mapping-logo.053a8f62ac4db3d32bd2.png\" alt=\"vim\" \/><\/a><\/p>\n<h2>\u5f00\u53d1Vim\u63d2\u4ef6\u7684\u57fa\u672c\u6b65\u9aa4<\/h2>\n<h3>1. \u786e\u5b9a\u63d2\u4ef6\u7684\u76ee\u6807\u548c\u529f\u80fd<\/h3>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u9996\u5148\u8981\u660e\u786e\u63d2\u4ef6\u7684\u76ee\u6807\u548c\u9884\u671f\u529f\u80fd\u3002\u8fd9\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u6709\u6548\u5730\u89c4\u5212\u63d2\u4ef6\u7684\u67b6\u6784\u548c\u5b9e\u73b0\u3002<\/p>\n<h3>2. \u521b\u5efa\u63d2\u4ef6\u76ee\u5f55\u7ed3\u6784<\/h3>\n<p>\u63a8\u8350\u7684\u63d2\u4ef6\u76ee\u5f55\u7ed3\u6784\u901a\u5e38\u9075\u5faaVim\u63d2\u4ef6\u7ba1\u7406\u5de5\u5177\u7684\u6807\u51c6\uff0c\u5982Pathogen\u3001Vundle\u6216vim-plug\u3002\u4ee5Pathogen\u4e3a\u4f8b\uff0c\u63d2\u4ef6\u53ef\u4ee5\u653e\u7f6e\u5728<code>~\/.vim\/bundle\/myplugin<\/code>\u76ee\u5f55\u4e0b\u3002<\/p>\n<h3>3. \u4f7f\u7528Vim\u811a\u672c\u7f16\u5199\u63d2\u4ef6<\/h3>\n<h4>\u793a\u4f8b\uff1a\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Vim\u811a\u672c\u63d2\u4ef6<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u8981\u521b\u5efa\u4e00\u4e2a\u63d2\u4ef6\uff0c\u63d0\u4f9b\u4e00\u4e2a\u65b0\u7684\u547d\u4ee4\u6765\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\u3002<\/p>\n<pre><code class=\"language-vim\">&quot; ~\/.vim\/bundle\/myplugin\/plugin\/myplugin.vim\n\n&quot; \u5b9a\u4e49\u4e00\u4e2a\u65b0\u547d\u4ee4\uff0c\u7528\u4e8e\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\ncommand! CountLines call CountLines()\n\n&quot; CountLines\u51fd\u6570\uff1a\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\nfunction! CountLines()\n    echo &quot;Total lines: &quot; . line(&quot;$&quot;)\nendfunction<\/code><\/pre>\n<h4>\u6dfb\u52a0Python\u652f\u6301<\/h4>\n<p>\u5982\u679c\u63d2\u4ef6\u9700\u8981\u66f4\u590d\u6742\u7684\u903b\u8f91\u6216\u9700\u8981\u8c03\u7528\u5916\u90e8\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u4f5c\u4e3a\u540e\u7aef\u6765\u7f16\u5199\u63d2\u4ef6\u7684\u4e00\u90e8\u5206\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Python\u6269\u5c55Vim\u63d2\u4ef6\u529f\u80fd\u7684\u793a\u4f8b\u3002<\/p>\n<h3>4. \u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6<\/h3>\n<h4>\u793a\u4f8b\uff1a\u4f7f\u7528Python\u7f16\u5199\u63d2\u4ef6\uff0c\u5b9e\u73b0\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u60f3\u8981\u521b\u5efa\u4e00\u4e2a\u63d2\u4ef6\uff0c\u63d0\u4f9b\u521b\u5efa\u548c\u5220\u9664\u6587\u4ef6\u7684\u529f\u80fd\u3002\u6211\u4eec\u5c06\u4f7f\u7528Python\u6765\u6267\u884c\u6587\u4ef6\u64cd\u4f5c\uff0c\u5e76\u901a\u8fc7Vim\u811a\u672c\u5c06\u5176\u7ed1\u5b9a\u4e3a\u65b0\u7684Vim\u547d\u4ee4\u3002<\/p>\n<pre><code class=\"language-python\"># ~\/.vim\/bundle\/myplugin\/python\/myplugin.py\n\nimport vim\nimport os\n\ndef create_file(filename):\n    with open(filename, &#039;w&#039;) as f:\n        f.write(&quot;This is a new file created by MyPlugin.\\n&quot;)\n\n    vim.command(&quot;edit &quot; + filename)\n    vim.command(&quot;normal gg&quot;)\n\ndef delete_file(filename):\n    os.remove(filename)\n    vim.command(&quot;echo &#039;File deleted: &quot; + filename + &quot;&#039;&quot;)\n\n# \u5c06Python\u51fd\u6570\u6620\u5c04\u4e3aVim\u547d\u4ee4\nvim.command(&quot;command! -nargs=1 CreateFile :call create_file(&lt;f-args&gt;)&quot;)\nvim.command(&quot;command! -nargs=1 DeleteFile :call delete_file(&lt;f-args&gt;)&quot;)<\/code><\/pre>\n<h4>\u5728Vim\u811a\u672c\u4e2d\u8c03\u7528Python\u51fd\u6570<\/h4>\n<p>\u4e3a\u4e86\u5728Vim\u811a\u672c\u4e2d\u4f7f\u7528Python\u7f16\u5199\u7684\u51fd\u6570\uff0c\u6211\u4eec\u9700\u8981\u5728Vim\u811a\u672c\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-vim\">&quot; ~\/.vim\/bundle\/myplugin\/plugin\/myplugin.vim\n\n&quot; \u5b9a\u4e49\u4e00\u4e2a\u65b0\u547d\u4ee4\uff0c\u7528\u4e8e\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\ncommand! CountLines call CountLines()\n\n&quot; CountLines\u51fd\u6570\uff1a\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\nfunction! CountLines()\n    echo &quot;Total lines: &quot; . line(&quot;$&quot;)\nendfunction\n\n&quot; \u5c06Python\u51fd\u6570\u6620\u5c04\u4e3aVim\u547d\u4ee4\nvim.command(&quot;command! -nargs=1 CreateFile :call create_file(&lt;f-args&gt;)&quot;)\nvim.command(&quot;command! -nargs=1 DeleteFile :call delete_file(&lt;f-args&gt;)&quot;)<\/code><\/pre>\n<h3>5. \u5b89\u88c5\u548c\u7ba1\u7406Vim\u63d2\u4ef6<\/h3>\n<h4>\u4f7f\u7528Pathogen\u7ba1\u7406\u63d2\u4ef6<\/h4>\n<p>Pathogen\u662f\u4e00\u4e2a\u6d41\u884c\u7684Vim\u63d2\u4ef6\u7ba1\u7406\u5de5\u5177\uff0c\u4f7f\u5f97\u5b89\u88c5\u3001\u66f4\u65b0\u548c\u5378\u8f7d\u63d2\u4ef6\u53d8\u5f97\u975e\u5e38\u7b80\u5355\u3002\u53ea\u9700\u5c06\u63d2\u4ef6\u514b\u9686\u5230<code>~\/.vim\/bundle\/<\/code>\u76ee\u5f55\u4e0b\u5373\u53ef\uff1a<\/p>\n<pre><code class=\"language-sh\">git clone https:\/\/github.com\/username\/myplugin.git ~\/.vim\/bundle\/myplugin<\/code><\/pre>\n<h4>\u4f7f\u7528vim-plug\u7ba1\u7406\u63d2\u4ef6<\/h4>\n<p>vim-plug\u662f\u53e6\u4e00\u4e2a\u5e7f\u6cdb\u4f7f\u7528\u7684Vim\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u5b83\u652f\u6301\u5e76\u884c\u5b89\u88c5\u548c\u66f4\u65b0\u63d2\u4ef6\u3002\u5728<code>.vimrc<\/code>\u6587\u4ef6\u4e2d\u6dfb\u52a0\u63d2\u4ef6\u58f0\u660e\uff0c\u5e76\u901a\u8fc7<code>:PlugInstall<\/code>\u547d\u4ee4\u5b89\u88c5\u63d2\u4ef6\uff1a<\/p>\n<pre><code class=\"language-vim\">&quot; ~\/.vimrc\n\ncall plug#begin(&#039;~\/.vim\/plugged&#039;)\n\nPlug &#039;username\/myplugin&#039;\n\ncall plug#end()<\/code><\/pre>\n<h3>\u793a\u4f8b\u63d2\u4ef6<\/h3>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7ed3\u5408\u4e86Vim\u811a\u672c\u548cPython\u7f16\u5199\u7684\u793a\u4f8b\u63d2\u4ef6\uff0c\u6f14\u793a\u4e86\u5982\u4f55\u6dfb\u52a0\u65b0\u547d\u4ee4\u6765\u7edf\u8ba1\u6587\u4ef6\u884c\u6570\u548c\u521b\u5efa\/\u5220\u9664\u6587\u4ef6\u7684\u529f\u80fd\uff1a<\/p>\n<pre><code class=\"language-vim\">&quot; ~\/.vim\/bundle\/myplugin\/plugin\/myplugin.vim\n\n&quot; \u5b9a\u4e49\u4e00\u4e2a\u65b0\u547d\u4ee4\uff0c\u7528\u4e8e\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\ncommand! CountLines call CountLines()\n\n&quot; CountLines\u51fd\u6570\uff1a\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\nfunction! CountLines()\n    echo &quot;Total lines: &quot; . line(&quot;$&quot;)\nendfunction\n\n&quot; ~\/.vim\/bundle\/myplugin\/python\/myplugin.py\n\nimport vim\nimport os\n\ndef create_file(filename):\n    with open(filename, &#039;w&#039;) as f:\n        f.write(&quot;This is a new file created by MyPlugin.\\n&quot;)\n\n    vim.command(&quot;edit &quot; + filename)\n    vim.command(&quot;normal gg&quot;)\n\ndef delete_file(filename):\n    os.remove(filename)\n    vim.command(&quot;echo &#039;File deleted: &quot; + filename + &quot;&#039;&quot;)\n\n&quot; \u5c06Python\u51fd\u6570\u6620\u5c04\u4e3aVim\u547d\u4ee4\nvim.command(&quot;command! -nargs=1 CreateFile :call create_file(&lt;f-args&gt;)&quot;)\nvim.command(&quot;command! -nargs=1 DeleteFile :call delete_file(&lt;f-args&gt;)&quot;)<\/code><\/pre>\n<h2>\u5916\u90e8\u53c2\u8003\u94fe\u63a5<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6709\u5173Vim\u63d2\u4ef6\u5f00\u53d1\u548cPython\u7f16\u7a0b\u7684\u5916\u90e8\u53c2\u8003\u94fe\u63a5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u8fdb\u4e00\u6b65\u6df1\u5165\u5b66\u4e60\u548c\u4e86\u89e3\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/vim.sourceforge.io\/scripts\/doc\/\">Vim \u63d2\u4ef6\u5f00\u53d1\u6587\u6863<\/a><\/li>\n<li><a href=\"https:\/\/learnvimscriptthehardway.stevelosh.com\/\">Learn Vimscript the Hard Way<\/a><\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/\">Python \u5b98\u65b9\u6587\u6863<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/tpope\/vim-pathogen\">Vim \u63d2\u4ef6\u7ba1\u7406\u5de5\u5177 Pathogen<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/junegunn\/vim-plug\">Vim \u63d2\u4ef6\u7ba1\u7406\u5de5\u5177 vim-plug<\/a><\/li>\n<\/ul>\n<h2>\u7ed3\u8bba<\/h2>\n<p>\u901a\u8fc7\u672c\u6587\uff0c\u60a8\u5b66\u4e60\u4e86\u5982\u4f55\u4f7f\u7528Vim\u811a\u672c\u548cPython\u8bed\u8a00\u5f00\u53d1\u548c\u7ba1\u7406\u81ea\u5b9a\u4e49\u7684Vim\u63d2\u4ef6\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u529f\u80fd\u589e\u5f3a\u8fd8\u662f\u590d\u6742\u7684\u6587\u4ef6\u64cd\u4f5c\uff0c\u60a8\u90fd\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u7f16\u5199\u63d2\u4ef6\uff0c\u5e76\u901a\u8fc7Vim\u7684\u63d2\u4ef6\u7ba1\u7406\u5de5\u5177\u8f7b\u677e\u5b89\u88c5\u548c\u4f7f\u7528\u5b83\u4eec\u3002<\/p>\n<p>\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u5982\u679c\u6709\u4efb\u4f55\u95ee\u9898\u6216\u5efa\u8bae\uff0c\u8bf7\u968f\u65f6\u7559\u8a00\u3002<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>Vim \u4f5c\u4e3a\u4e00\u6b3e\u9ad8\u5ea6\u53ef\u5b9a\u5236\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u5141\u8bb8\u7528\u6237\u901a\u8fc7\u7f16\u5199\u63d2\u4ef6\u6765\u6269\u5c55\u5176\u529f\u80fd\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u63d2\u4ef6\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u8fd9\u4e9b\u63d2\u4ef6\u3002 \u4ec0\u4e48\u662fVim\u63d2\u4ef6\uff1f Vim\u63d2\u4ef6\u662f\u4e00\u7ec4\u811a\u672c\u6216\u7a0b\u5e8f\uff0c\u7528\u4e8e\u589e\u5f3a\u548c\u5b9a\u5236Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\u3002\u5b83\u4eec\u53ef\u4ee5\u5b9e\u73b0\u5404\u79cd\u4efb\u52a1\uff0c\u5982\u8bed\u6cd5\u9ad8\u4eae\u3001\u81ea\u52a8\u5b8c\u6210\u3001\u6587\u4ef6\u64cd\u4f5c\u3001\u96c6\u6210\u5916\u90e8\u5de5\u5177\u7b49\u3002 \u5f00\u53d1Vim\u63d2\u4ef6\u7684\u57fa\u672c\u6b65\u9aa4 1. \u786e\u5b9a\u63d2\u4ef6\u7684\u76ee\u6807\u548c\u529f\u80fd \u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u9996\u5148\u8981\u660e\u786e\u63d2\u4ef6\u7684\u76ee\u6807\u548c\u9884\u671f\u529f\u80fd\u3002\u8fd9\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u6709\u6548\u5730\u89c4\u5212\u63d2\u4ef6\u7684\u67b6\u6784\u548c\u5b9e\u73b0\u3002 2. \u521b\u5efa\u63d2\u4ef6\u76ee\u5f55\u7ed3\u6784 \u63a8\u8350\u7684\u63d2\u4ef6\u76ee\u5f55\u7ed3\u6784\u901a\u5e38\u9075\u5faaVim\u63d2\u4ef6\u7ba1\u7406\u5de5\u5177\u7684\u6807\u51c6\uff0c\u5982Pathogen\u3001Vundle\u6216vim-plug\u3002\u4ee5Pathogen\u4e3a\u4f8b\uff0c\u63d2\u4ef6\u53ef\u4ee5\u653e\u7f6e\u5728~\/.vim\/bundle\/myplugin\u76ee\u5f55\u4e0b\u3002 3. \u4f7f\u7528Vim\u811a\u672c\u7f16\u5199\u63d2\u4ef6 \u793a\u4f8b\uff1a\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Vim\u811a\u672c\u63d2\u4ef6 \u5047\u8bbe\u6211\u4eec\u8981\u521b\u5efa\u4e00\u4e2a\u63d2\u4ef6\uff0c\u63d0\u4f9b\u4e00\u4e2a\u65b0\u7684\u547d\u4ee4\u6765\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570\u3002 &quot; ~\/.vim\/bundle\/myplugin\/plugin\/myplugin.vim &quot; \u5b9a\u4e49\u4e00\u4e2a\u65b0\u547d\u4ee4\uff0c\u7528\u4e8e\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570 command! CountLines call CountLines() &quot; CountLines\u51fd\u6570\uff1a\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570 function! CountLines() echo &quot;Total lines: &quot; . line(&quot;$&quot;) endfunction \u6dfb\u52a0Python\u652f\u6301 \u5982\u679c\u63d2\u4ef6\u9700\u8981\u66f4\u590d\u6742\u7684\u903b\u8f91\u6216\u9700\u8981\u8c03\u7528\u5916\u90e8\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u4f5c\u4e3a\u540e\u7aef\u6765\u7f16\u5199\u63d2\u4ef6\u7684\u4e00\u90e8\u5206\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Python\u6269\u5c55Vim\u63d2\u4ef6\u529f\u80fd\u7684\u793a\u4f8b\u3002 4. \u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6 \u793a\u4f8b\uff1a\u4f7f\u7528Python\u7f16\u5199\u63d2\u4ef6\uff0c\u5b9e\u73b0\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd \u5047\u8bbe\u6211\u4eec\u60f3\u8981\u521b\u5efa\u4e00\u4e2a\u63d2\u4ef6\uff0c\u63d0\u4f9b\u521b\u5efa\u548c\u5220\u9664\u6587\u4ef6\u7684\u529f\u80fd\u3002\u6211\u4eec\u5c06\u4f7f\u7528Python\u6765\u6267\u884c\u6587\u4ef6\u64cd\u4f5c\uff0c\u5e76\u901a\u8fc7Vim\u811a\u672c\u5c06\u5176\u7ed1\u5b9a\u4e3a\u65b0\u7684Vim\u547d\u4ee4\u3002 # ~\/.vim\/bundle\/myplugin\/python\/myplugin.py import vim import os def create_file(filename): with open(filename, &#039;w&#039;) as f: f.write(&quot;This is a new file created by MyPlugin.\\n&quot;) vim.command(&quot;edit &quot; + filename) vim.command(&quot;normal gg&quot;) def delete_file(filename): os.remove(filename) vim.command(&quot;echo &#039;File deleted: &quot; + filename + &quot;&#039;&quot;) # \u5c06Python\u51fd\u6570\u6620\u5c04\u4e3aVim\u547d\u4ee4 vim.command(&quot;command! -nargs=1 CreateFile :call create_file(&lt;f-args&gt;)&quot;) vim.command(&quot;command! -nargs=1 DeleteFile :call delete_file(&lt;f-args&gt;)&quot;) \u5728Vim\u811a\u672c\u4e2d\u8c03\u7528Python\u51fd\u6570 \u4e3a\u4e86\u5728Vim\u811a\u672c\u4e2d\u4f7f\u7528Python\u7f16\u5199\u7684\u51fd\u6570\uff0c\u6211\u4eec\u9700\u8981\u5728Vim\u811a\u672c\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u547d\u4ee4\uff1a &quot; ~\/.vim\/bundle\/myplugin\/plugin\/myplugin.vim &quot; \u5b9a\u4e49\u4e00\u4e2a\u65b0\u547d\u4ee4\uff0c\u7528\u4e8e\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570 command! CountLines call CountLines() &quot; CountLines\u51fd\u6570\uff1a\u7edf\u8ba1\u5f53\u524d\u6587\u4ef6\u7684\u884c\u6570 function! CountLines() echo &quot;Total lines: &quot; . line(&quot;$&quot;) endfunction &quot; \u5c06Python\u51fd\u6570\u6620\u5c04\u4e3aVim\u547d\u4ee4 vim.command(&quot;command! -nargs=1 CreateFile :call create_file(&lt;f-args&gt;)&quot;) vim.command(&quot;command! -nargs=1 DeleteFile :call delete_file(&lt;f-args&gt;)&quot;) 5. \u5b89\u88c5\u548c\u7ba1\u7406Vim\u63d2\u4ef6 \u4f7f\u7528Pathogen\u7ba1\u7406\u63d2\u4ef6 Pathogen\u662f\u4e00\u4e2a\u6d41\u884c\u7684Vim\u63d2\u4ef6\u7ba1\u7406\u5de5\u5177\uff0c\u4f7f\u5f97\u5b89\u88c5\u3001\u66f4\u65b0\u548c\u5378\u8f7d&#8230;<\/p>\n","protected":false},"author":1,"featured_media":199,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[82,84],"tags":[113,111,109,86],"class_list":["post-149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools","category-vim-zh","tag-ide","tag-plugin","tag-python","tag-vim"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357 - TianYa Blog Vim<\/title>\n<meta name=\"description\" content=\"\u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u901a\u8fc7 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u7684Vim\u63d2\u4ef6\uff0c\u5305\u62ec\u5e38\u89c1\u7684\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u63d2\u4ef6\u7684\u521b\u5efa\u3001\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u901a\u8fc7\u8fd9\u4e9b\u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6269\u5c55\u548c\u4f18\u5316Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u6ee1\u8db3\u4e2a\u6027\u5316\u548c\u4e13\u4e1a\u5316\u7684\u6587\u672c\u7f16\u8f91\u9700\u6c42\u3002\u5e76\u4e14\u7ed9\u51fa\u4e86python\u5f00\u53d1\u7684demo\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/\u4f7f\u7528-python-\u7f16\u5199-vim-\u63d2\u4ef6\u6307\u5357\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357 - TianYa Blog Vim\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u901a\u8fc7 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u7684Vim\u63d2\u4ef6\uff0c\u5305\u62ec\u5e38\u89c1\u7684\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u63d2\u4ef6\u7684\u521b\u5efa\u3001\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u901a\u8fc7\u8fd9\u4e9b\u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6269\u5c55\u548c\u4f18\u5316Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u6ee1\u8db3\u4e2a\u6027\u5316\u548c\u4e13\u4e1a\u5316\u7684\u6587\u672c\u7f16\u8f91\u9700\u6c42\u3002\u5e76\u4e14\u7ed9\u51fa\u4e86python\u5f00\u53d1\u7684demo\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/\u4f7f\u7528-python-\u7f16\u5199-vim-\u63d2\u4ef6\u6307\u5357\/\" \/>\n<meta property=\"og:site_name\" content=\"TianYa Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-19T13:45:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-22T10:16:15+00:00\" \/>\n<meta name=\"author\" content=\"zdm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zdm\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/\"},\"author\":{\"name\":\"zdm\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\"},\"headline\":\"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357\",\"datePublished\":\"2024-06-19T13:45:51+00:00\",\"dateModified\":\"2024-06-22T10:16:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/\"},\"wordCount\":57,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\"},\"image\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.swreader.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/vim.avif\",\"keywords\":[\"IDE\",\"plugin\",\"python\",\"Vim\"],\"articleSection\":[\"Tools\",\"Vim\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/\",\"url\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/\",\"name\":\"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357 - TianYa Blog Vim\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.swreader.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/vim.avif\",\"datePublished\":\"2024-06-19T13:45:51+00:00\",\"dateModified\":\"2024-06-22T10:16:15+00:00\",\"description\":\"\u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u901a\u8fc7 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u7684Vim\u63d2\u4ef6\uff0c\u5305\u62ec\u5e38\u89c1\u7684\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u63d2\u4ef6\u7684\u521b\u5efa\u3001\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u901a\u8fc7\u8fd9\u4e9b\u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6269\u5c55\u548c\u4f18\u5316Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u6ee1\u8db3\u4e2a\u6027\u5316\u548c\u4e13\u4e1a\u5316\u7684\u6587\u672c\u7f16\u8f91\u9700\u6c42\u3002\u5e76\u4e14\u7ed9\u51fa\u4e86python\u5f00\u53d1\u7684demo\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.swreader.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/vim.avif\",\"contentUrl\":\"https:\\\/\\\/www.swreader.com\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/vim.avif\",\"width\":1000,\"height\":420},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/2024\\\/06\\\/19\\\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/www.swreader.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#website\",\"url\":\"https:\\\/\\\/www.swreader.com\\\/\",\"name\":\"TianYa Blog\",\"description\":\"Technology And Life\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.swreader.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.swreader.com\\\/#\\\/schema\\\/person\\\/9c90501e33afc9307d757bc8cfaf1c6f\",\"name\":\"zdm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\",\"caption\":\"zdm\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g\"},\"sameAs\":[\"http:\\\/\\\/www.swreader.com\"],\"url\":\"https:\\\/\\\/www.swreader.com\\\/index.php\\\/author\\\/zdm\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357 - TianYa Blog Vim","description":"\u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u901a\u8fc7 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u7684Vim\u63d2\u4ef6\uff0c\u5305\u62ec\u5e38\u89c1\u7684\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u63d2\u4ef6\u7684\u521b\u5efa\u3001\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u901a\u8fc7\u8fd9\u4e9b\u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6269\u5c55\u548c\u4f18\u5316Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u6ee1\u8db3\u4e2a\u6027\u5316\u548c\u4e13\u4e1a\u5316\u7684\u6587\u672c\u7f16\u8f91\u9700\u6c42\u3002\u5e76\u4e14\u7ed9\u51fa\u4e86python\u5f00\u53d1\u7684demo","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/\u4f7f\u7528-python-\u7f16\u5199-vim-\u63d2\u4ef6\u6307\u5357\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357 - TianYa Blog Vim","og_description":"\u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u901a\u8fc7 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u7684Vim\u63d2\u4ef6\uff0c\u5305\u62ec\u5e38\u89c1\u7684\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u63d2\u4ef6\u7684\u521b\u5efa\u3001\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u901a\u8fc7\u8fd9\u4e9b\u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6269\u5c55\u548c\u4f18\u5316Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u6ee1\u8db3\u4e2a\u6027\u5316\u548c\u4e13\u4e1a\u5316\u7684\u6587\u672c\u7f16\u8f91\u9700\u6c42\u3002\u5e76\u4e14\u7ed9\u51fa\u4e86python\u5f00\u53d1\u7684demo","og_url":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/\u4f7f\u7528-python-\u7f16\u5199-vim-\u63d2\u4ef6\u6307\u5357\/","og_site_name":"TianYa Blog","article_published_time":"2024-06-19T13:45:51+00:00","article_modified_time":"2024-06-22T10:16:15+00:00","author":"zdm","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zdm","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#article","isPartOf":{"@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/"},"author":{"name":"zdm","@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f"},"headline":"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357","datePublished":"2024-06-19T13:45:51+00:00","dateModified":"2024-06-22T10:16:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/"},"wordCount":57,"commentCount":0,"publisher":{"@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f"},"image":{"@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#primaryimage"},"thumbnailUrl":"https:\/\/www.swreader.com\/wp-content\/uploads\/2024\/06\/vim.avif","keywords":["IDE","plugin","python","Vim"],"articleSection":["Tools","Vim"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/","url":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/","name":"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357 - TianYa Blog Vim","isPartOf":{"@id":"https:\/\/www.swreader.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#primaryimage"},"image":{"@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#primaryimage"},"thumbnailUrl":"https:\/\/www.swreader.com\/wp-content\/uploads\/2024\/06\/vim.avif","datePublished":"2024-06-19T13:45:51+00:00","dateModified":"2024-06-22T10:16:15+00:00","description":"\u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u901a\u8fc7 Vim \u811a\u672c\u548c Python \u8bed\u8a00\u5f00\u53d1\u81ea\u5b9a\u4e49\u7684Vim\u63d2\u4ef6\uff0c\u5305\u62ec\u5e38\u89c1\u7684\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u63d2\u4ef6\u7684\u521b\u5efa\u3001\u5b89\u88c5\u3001\u7ba1\u7406\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u901a\u8fc7\u8fd9\u4e9b\u63d2\u4ef6\uff0c\u60a8\u53ef\u4ee5\u6269\u5c55\u548c\u4f18\u5316Vim\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u6ee1\u8db3\u4e2a\u6027\u5316\u548c\u4e13\u4e1a\u5316\u7684\u6587\u672c\u7f16\u8f91\u9700\u6c42\u3002\u5e76\u4e14\u7ed9\u51fa\u4e86python\u5f00\u53d1\u7684demo","breadcrumb":{"@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#primaryimage","url":"https:\/\/www.swreader.com\/wp-content\/uploads\/2024\/06\/vim.avif","contentUrl":"https:\/\/www.swreader.com\/wp-content\/uploads\/2024\/06\/vim.avif","width":1000,"height":420},{"@type":"BreadcrumbList","@id":"https:\/\/www.swreader.com\/index.php\/2024\/06\/19\/%e4%bd%bf%e7%94%a8-python-%e7%bc%96%e5%86%99-vim-%e6%8f%92%e4%bb%b6%e6%8c%87%e5%8d%97\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.swreader.com\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528Python\u7f16\u5199Vim\u63d2\u4ef6\u6307\u5357"}]},{"@type":"WebSite","@id":"https:\/\/www.swreader.com\/#website","url":"https:\/\/www.swreader.com\/","name":"TianYa Blog","description":"Technology And Life","publisher":{"@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.swreader.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.swreader.com\/#\/schema\/person\/9c90501e33afc9307d757bc8cfaf1c6f","name":"zdm","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g","caption":"zdm"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/2670c9b6412a56381880b2ca03988f659e8a378fe7332238a4a741b660a60997?s=96&d=mm&r=g"},"sameAs":["http:\/\/www.swreader.com"],"url":"https:\/\/www.swreader.com\/index.php\/author\/zdm\/"}]}},"_links":{"self":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":3,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/posts\/149\/revisions\/197"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/media\/199"}],"wp:attachment":[{"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.swreader.com\/index.php\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}