Say I have this line of code:
$query = "SELECT * FROM table";
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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
ci", which means: change what inside the double quotes.You can also manipulate other text objects in a similar way, e.g.:
ci'– change inside the single quotesciw– change inside a wordci(– change inside parenthesesdit– delete inside an HTML tag, etc.More about different vim text objects here.