{"id":83994,"date":"2020-05-13T09:41:16","date_gmt":"2020-05-13T01:41:16","guid":{"rendered":"http:\/\/4563.org\/?p=83994"},"modified":"2020-05-13T09:41:16","modified_gmt":"2020-05-13T01:41:16","slug":"%e7%94%a8-vim-%e7%bc%96%e8%be%91-markdown-%e6%97%b6%e7%9b%b4%e6%8e%a5%e7%b2%98%e8%b4%b4%e5%9b%be%e7%89%87","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=83994","title":{"rendered":"\u7528 Vim \u7f16\u8f91 Markdown \u65f6\u76f4\u63a5\u7c98\u8d34\u56fe\u7247"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u7528 Vim \u7f16\u8f91 Markdown \u65f6\u76f4\u63a5\u7c98\u8d34\u56fe\u7247               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mzlogin <\/span>  <span><i><\/i> 9<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u4e60\u60ef\u4f7f\u7528 Vim \u7f16\u8f91 Markdown \u6587\u4ef6\uff0c\u4e00\u76f4\u5b58\u5728\u4e00\u4e2a\u75db\u70b9\u5c31\u662f\u7c98\u8d34\u56fe\u7247\u5f88\u4e0d\u65b9\u4fbf\u3002<\/p>\n<h2>\u524d\u540e\u5bf9\u6bd4<\/h2>\n<p>\u6211\u4ee5\u524d\u5e38\u7528\u7684\u64cd\u4f5c\u6d41\u7a0b\uff1a<\/p>\n<ol>\n<li>\u590d\u5236\u56fe\u7247 \/\u622a\u56fe\uff1b<\/li>\n<li>\u5728\u4fdd\u5b58\u56fe\u7247\u5bf9\u8bdd\u6846\u91cc\u4e00\u5c42\u5c42\u70b9\u9009\u4fdd\u5b58\u8def\u5f84\uff0c\u8f93\u5165\u6587\u4ef6\u540d\u4fdd\u5b58\uff1b<\/li>\n<li>\u56de\u5230 Vim \u91cc\uff0c\u624b\u52a8\u8f93\u5165\u5f15\u7528\u56fe\u7247\u7684\u8868\u8fbe\u5f0f\u3002<\/li>\n<\/ol>\n<p>\u7b2c 2 \u6b65\u548c\u7b2c 3 \u6b65\u662f\u6bd4\u8f83\u75db\u82e6\u7684\uff0c\u5c24\u5176\u662f\u6587\u4ef6\u8def\u5f84\u6bd4\u8f83\u6df1\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u8981\u70b9\u9009\u597d\u51e0\u6b21\u3002<\/p>\n<p>\u6700\u8fd1\u5076\u7136\u53d1\u73b0\u7684\u4e00\u4e2a\u5916\u56fd\u5c0f\u4f19\u5199\u7684\u63d2\u4ef6 md-img-paste.vim^1\uff0c\u80fd\u6bd4\u8f83\u597d\u5730\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u73b0\u5728\u7684\u64cd\u4f5c\u6d41\u7a0b\uff1a<\/p>\n<ol>\n<li>\n<p>\u590d\u5236\u56fe\u7247 \/\u622a\u56fe\uff1b<\/p>\n<\/li>\n<li>\n<p>\u5728 Vim \u91cc\u8f93\u5165\u56fe\u7247\u76f8\u5bf9\u8def\u5f84\uff0c\u81ea\u52a8\u4fdd\u5b58\u56fe\u7247\u5e76\u63d2\u5165\u5f15\u7528\u56fe\u7247\u7684\u8868\u8fbe\u5f0f\u3002<\/p>\n<p><em>\u6ce8\uff1a\u4e5f\u53ef\u4ee5\u76f4\u63a5\u56de\u8f66\uff0c\u4f1a\u6309\u9ed8\u8ba4\u89c4\u5219\u751f\u6210\u6587\u4ef6\u540d\u3002<\/em><\/p>\n<\/li>\n<\/ol>\n<p>\u6548\u679c\u6f14\u793a\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200515_5ebf10d9c8fc3.gif\" alt=\"\u7528 Vim \u7f16\u8f91 Markdown \u65f6\u76f4\u63a5\u7c98\u8d34\u56fe\u7247\" \/><\/p>\n<h2>\u4f7f\u7528\u65b9\u6cd5<\/h2>\n<h3>\u5b89\u88c5<\/h3>\n<p>\u8fd9\u4e2a\u63d2\u4ef6\u6ca1\u6709\u5176\u5b83\u4f9d\u8d56\uff0c\u4f7f\u7528\u81ea\u5df1\u4e60\u60ef\u7684\u63d2\u4ef6\u7ba1\u7406\u65b9\u5f0f\u5b89\u88c5\u5c31\u597d\u3002<\/p>\n<p>\u6bd4\u5982\u6211\u4f7f\u7528 Vundle^2\uff0c\u5728 vimrc \u91cc\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff0c\u7136\u540e <code>:so $MYVIMRC<\/code> \u518d <code>:PluginInstall<\/code> \u5c31\u597d\u4e86\u3002<\/p>\n<pre><code>Plugin 'ferrine\/md-img-paste.vim' <\/code><\/pre>\n<h3>\u914d\u7f6e<\/h3>\n<p>\u63d2\u4ef6\u6ca1\u6709\u7ed9\u7c98\u8d34\u526a\u8d34\u677f\u91cc\u7684\u56fe\u7247\u7684\u64cd\u4f5c\u7ed1\u5b9a\u9ed8\u8ba4\u5feb\u6377\u952e\uff0c\u9700\u8981\u81ea\u5df1\u7ed1\u5b9a\u4e00\u4e0b\uff0c\u6bd4\u5982\u6211\u662f\u7ed1\u5b9a\u5230 &lt;kbd&gt;&lt;leader&gt;i&lt;\/kbd&gt;\uff1a<\/p>\n<pre><code>autocmd FileType markdown nmap &lt;buffer&gt;&lt;silent&gt; &lt;leader&gt;i :call mdip#MarkdownClipboardImage()&lt;CR&gt; <\/code><\/pre>\n<p>\u53e6\u5916\u8fd8\u6709\u4e24\u4e2a\u53ef\u9009\u914d\u7f6e\u9879\uff1a<\/p>\n<pre><code>let g:mdip_imgdir = '.' \" let g:mdip_imgname = 'image' <\/code><\/pre>\n<ol>\n<li><code>g:mdip_imgdir<\/code> \u5bf9\u5e94\u56fe\u7247\u4fdd\u5b58\u8def\u5f84\u524d\u7f00\u3002\u6211\u8bbe\u7f6e\u4e3a\u4e86 <code>.<\/code>\uff0c\u7136\u540e\u603b\u662f\u8f93\u5165\u76f8\u5bf9\u5f53\u524d\u6587\u4ef6\u7684\u8def\u5f84\uff1b<\/li>\n<li><code>g:mdip_imgname<\/code> \u5bf9\u5e94\u56fe\u7247\u4fdd\u5b58\u65f6\u7684\u7f3a\u7701\u6587\u4ef6\u540d\u524d\u7f00\uff0c\u5373\u7c98\u8d34\u56fe\u7247\u65f6\uff0c\u5982\u679c\u4e0d\u8f93\u5165\u6587\u4ef6\u540d\u76f4\u63a5\u56de\u8f66\uff0c\u5c06\u4fdd\u5b58\u4e3a <code>&lt;\u524d\u7f00&gt;_\u65e5\u671f-\u65f6\u95f4.png<\/code> \u540d\u79f0\u7684\u6587\u4ef6\u3002<\/li>\n<\/ol>\n<p>\u6211\u7684\u5b8c\u6574 Vim \u914d\u7f6e\u6587\u4ef6\u6258\u7ba1\u5728 GitHub^3\uff0c\u4f9b\u53c2\u8003\u3002<\/p>\n<p>It&#8217;s done, enjoy it.<\/p>\n<ul>\n<li>https:\/\/github.com\/ferrine\/md-img-paste.vim<\/li>\n<li>https:\/\/github.com\/VundleVim\/Vundle.vim<\/li>\n<li>https:\/\/github.com\/mzlogin\/config-files\/blob\/master\/_vimrc<\/li>\n<\/ul><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1395067\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : learningman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u5916\u56fd\u5c0f\u4f19\u3002\u3002\u3002\u4e0d\u9002\u611f\u4e00\u4e0b\u5c31\u4e0a\u6765\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1395068\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jdhao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u7528\u56fe\u5e8a\u653e\u56fe\u7247\u5417\uff0c\u56fe\u7247\u548c Markdown \u6587\u4ef6\u653e\u4e00\u4e2a\u76ee\u5f55\u4e0d\u4f1a\u5bfc\u81f4\u535a\u5ba2\u6587\u4ef6\u592a\u5927\uff1f\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1395069\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : mzlogin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @learningman \u554a\u2026\u2026\u8fd9\u4e2a\u8868\u8fbe\uff0c\u6ca1\u6709\u6076\u610f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1395070\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : mzlogin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @jdhao \u6309\u6211\u7684\u4f7f\u7528\u60c5\u51b5\u6765\u770b\u8fd8\u597d\uff0c\u4e5f\u8bb8\u662f\u6211\u8d34\u56fe\u4e5f\u4e0d\u662f\u7279\u522b\u591a\u2026\u2026[\u6211\u7684\u535a\u5ba2]( https:\/\/mazhuang.org) \u4e5f\u6709\u5c0f\u4e8c\u767e\u7bc7\u4e1c\u897f\u5427\uff0c\u76ee\u524d\u4ed3\u5e93\u5927\u5c0f 21MB \u5de6\u53f3\u3002\u91cc\u7684\u6240\u4ee5\u76ee\u524d\u7684\u65b9\u6848\u662f\u76f4\u63a5\u653e\u4ed3\u5e93\u91cc\uff0c\u7136\u540e\u7f16\u8bd1\u7684\u65f6\u5019\u81ea\u52a8\u628a\u56fe\u7247\u5730\u5740\u6539\u5230 jsdelivr cdn \u7684\u8bbf\u95ee\u5730\u5740\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1395071\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yzlnew <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u63a8\u8350\u4ece Vundle \u8fc1\u79fb\u5230 vim-plug                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u7528 Vim \u7f16\u8f91 Markdown&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/83994"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83994"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/83994\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83994"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}