{"id":626,"date":"2014-08-10T11:24:10","date_gmt":"2014-08-10T11:24:10","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=626"},"modified":"2015-08-17T10:53:06","modified_gmt":"2015-08-17T10:53:06","slug":"how-to-replace-text-between-quotes-in-vi","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/stack-overflow\/how-to-replace-text-between-quotes-in-vi\/","title":{"rendered":"How to replace text between quotes in vi or vim?"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/users\/534755\/nikola\"><img loading=\"lazy\" decoding=\"async\" title=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" src=\"http:\/\/stackoverflow.com\/users\/flair\/534755.png\" rel=\"lightbox[626]\" alt=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" width=\"208\" height=\"58\" \/><\/a><br \/>\nI&#8217;m a big fan of <a href=\"http:\/\/stackoverflow.com\/\">Stack Overflow<\/a> and I tend to contribute regularly (am currently in the <a href=\"http:\/\/stackexchange.com\/leagues\/1\/alltime\/stackoverflow\/2008-07-31\/534755?sort=reputationchange#534755\">top 0.X%<\/a>).\u00a0In this category (<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/category\/stack-overflow\/\">stackoverflow<\/a>)\u00a0of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread <a href=\"http:\/\/meta.stackoverflow.com\/questions\/266971\/can-i-post-so-questions-and-answers-in-a-personal-blog\/266973\">here<\/a>.<\/p>\n<p>So, <a href=\"http:\/\/stackoverflow.com\/questions\/11630440\/how-to-replace-text-between-quotes-in-vi\">my question<\/a>\u00a0wa<span style=\"color: #000000;\">s if for example we have this line of code:<\/span><\/p>\n<pre class=\"lang:default decode:true \">$query = \"SELECT * FROM table\";<\/pre>\n<p>is there a command in vi\/vim which can instantly delete everything between quotes and position the cursor between them so I can start typing immediatelly?<\/p>\n<p>The answer, by user\u00a0eugene y, was:<\/p>\n<blockquote>\n<p style=\"color: #000000;\">Use\u00a0<code>ci\"<\/code>, which means: change what&#8217;s inside the double quotes.<\/p>\n<p style=\"color: #000000;\">You can also manipulate other text objects in a similar way, e.g.:<\/p>\n<ul style=\"color: #000000;\">\n<li><code>ciw<\/code>\u00a0&#8211; change inside a word<\/li>\n<li><code>ci(<\/code>\u00a0&#8211; change inside parentheses<\/li>\n<li><code>dit<\/code>\u00a0&#8211; delete inside an HTML tag, etc.<\/li>\n<\/ul>\n<p style=\"color: #000000;\">More about different vim text objects\u00a0<a style=\"color: #4a6b82;\" href=\"http:\/\/blog.carbonfive.com\/2011\/10\/17\/vim-text-objects-the-definitive-guide\/\">here<\/a>.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%).\u00a0In this category (stackoverflow)\u00a0of posts I will will be posting&hellip;<\/p>\n","protected":false},"author":1,"featured_media":609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-626","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stack-overflow"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=626"}],"version-history":[{"count":4,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/626\/revisions"}],"predecessor-version":[{"id":2110,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/626\/revisions\/2110"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}