vim: delete all whitespace characters up to my cursor

randombits picture randombits · Sep 24, 2010 · Viewed 7.1k times · Source

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?

Answer

Neall picture Neall · Sep 24, 2010

d w