vim

VIM: Deleting from current position until a space


Often when developing I am confronted with a nested object that I'd like to delete from code in the middle of a line like this:

htmlDoc.WriteLine("<b><h3>" + this.cbAllSyncs.SelectedItem.ToString() + "</h3></b>");

The part that I'd like to delete is:

this.cbAllSyncs.SelectedItem.ToString()

I know I can count the number of words and periods and enter 7dw to delete from my current cursor position of "this". However, what I'd love to do is not have to count at all and delete to the space with one command. Is this possible?


Solution

  • Try dtspace. In general dtx deletes from current position till just before x. Just tx moves the cursor to just before character x in current line.

    To delete up to and including the space, use dfspace.