{"id":2013,"date":"2013-04-30T11:01:33","date_gmt":"2013-04-30T03:01:33","guid":{"rendered":"http:\/\/rmohan.com\/?p=2013"},"modified":"2013-04-30T11:01:33","modified_gmt":"2013-04-30T03:01:33","slug":"vi-search-and-replace-with-a-pathname","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2013","title":{"rendered":"VI &#8211; Search and Replace with a pathname"},"content":{"rendered":"<p>Find and replace with VI on a pathname is a bit tricky you ned to use escape characters.<\/p>\n<p>In this case\u00a0<b>\/bin\/mail<\/b>\u00a0should be replaced with\u00a0<b>\/usr\/bin\/mail<\/b><\/p>\n<p>The command below would do it:<\/p>\n<p><b>:%s\/\\\/bin\\\/mail\/\\\/usr\\\/bin\\\/mail\/g<\/b><\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"sites-page-title-header\" align=\"left\">Find and Replace Example<\/h3>\n<p>Here is an example of find and replace with VI, this will replace every instance of the &#8220;findthistext&#8221; string in the file with &#8220;replacewithtext&#8221;. Neat saves lots of typing!<\/p>\n<p>:%s\/findthistext\/replacewithtext\/g<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find and replace with VI on a pathname is a bit tricky you ned to use escape characters.<\/p>\n<p>In this case \/bin\/mail should be replaced with \/usr\/bin\/mail<\/p>\n<p>The command below would do it:<\/p>\n<p>:%s\/\\\/bin\\\/mail\/\\\/usr\\\/bin\\\/mail\/g<\/p>\n<p>&nbsp;<\/p>\n<p> Find and Replace Example <\/p>\n<p>Here is an example of find and replace with VI, this will replace every instance of [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2013"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2013"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2013\/revisions"}],"predecessor-version":[{"id":2014,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2013\/revisions\/2014"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}