Vim - delete up to searched string

Martin Janiczek picture Martin Janiczek · Dec 22, 2011 · Viewed 13.8k times · Source

Is there a VIM command / key combination that would do something like dt/mystring (which doesn't work)?

dta tries to find letter a on current line, but I'd like to delete everything up to searched string (possibly on some other line).

Answer

Greg Reynolds picture Greg Reynolds · Dec 22, 2011

Try this

d/mystring

It won't delete the string itself.