Alex Rivera | Logout

vim: delete all whitespace characters up to my cursor

Asked 2010-09-24T16:29:37.023
19

is there anyway to delete every character on the same line as a cursor, all the way up to the cursor? for instance, I might have a line of code that looks like the following:

foo = [cursor]             Bar.new

If my cursor is at the place holder above, is it possible to delete every whitespace character (without using regex?) so that Bar.new is placed at the cursor?

Edit
Report

1 Answer

9

Not quite what you want, but perhaps d i w would help - in the example above, it would delete all the whitespace between the = and the Bar. Perhaps c i w space would give you the result you are looking for?

answered 2010-09-24T17:00:59.207

Your Answer