Vim delete text with search command

Tags: vim

With Vim, you can use combine delete (d) with search command (/search-keyword) to delete text from the current position of cursor to text that you search.

In this Gif image shows you how to delete all text from the beginning to World word.

So the command is d + /world then enter to execute the command. By default vim is case sensitive search but I set my editor to be case insensitive so I can search with a lower case.

delete text with search