Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete until end of delimiter?

Tags:

vim

In vim, I know that typing di' will delete text inclosed by a single apostrophe,

'hello world' => <di'> => ''

but lets say I want to delete until the end of the apostrophe?

For example:

'hello world' => <delete command with cursor on w> => 'hello '

Is there an obvious way to do this?

like image 963
keyworks Avatar asked May 18 '12 18:05

keyworks


1 Answers

I think this is what you want:

dt'

Use the mnemonic "delete till '" to remember. dT' will delete backwards leaving you with "world". There is also df' that will delete everything, including the apostrophe. More information on find and till is available here.

like image 113
gpojd Avatar answered Sep 28 '22 16:09

gpojd