Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim: delete all whitespace characters up to my cursor

Tags:

vim

macvim

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?

like image 536
randombits Avatar asked Sep 24 '10 16:09

randombits


People also ask

How do I remove leading spaces in vi?

If you want to remove the leading spaces from all lines to the end of the buffer, use <G and then . repeatedly.


1 Answers

d w

like image 119
Neall Avatar answered Oct 05 '22 23:10

Neall