Search code examples
vimkeyboardshortcut

Vim - delete up to searched string


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).


Solution

  • Try this

    d/mystring
    

    It won't delete the string itself.