VIM: Deleting from current position until a space

ID : 20075

viewed : 3

Tags : vimvim

Top 5 Answer for VIM: Deleting from current position until a space

vote vote


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.

vote vote


You can use dW or dE as @glenn suggested if you don't want to delete the space itself.

A WORD (uppercase W) consists of a sequence of non-blank characters, separated with white space.

Give a look to the word motions.

vote vote


one possible solution is to use the delete with a search.

so type in d/<space> and vim will delete until it hits a space.

vote vote


If you want to delete from anywhere inside the WORD, and in a single command, just use daW

(you can of course use daw if you want to limit to a word)

I use it quite a lot because it spare a move to the begining of the word (in your case)

vote vote


  • delete for the current position to a specific character example "

  • delete the word from the position cursor is on till the end of the word

  • delete the entire word the cursor is on irrespective of the position the cursor is on the word, this also puts you in insert mode to enable you to insert immediately.


Top 3 video Explaining VIM: Deleting from current position until a space