vi to delete from the beginning of the line till the cursor

blue123 picture blue123 · Jan 9, 2013 · Viewed 39.1k times · Source

How can we use vim to delete characters from the beginning of the line till the cursor. Say, we have a string "hello world" while the cursor is on "w". How can we delete from "h" till "w".

Answer

Lars Kotthoff picture Lars Kotthoff · Jan 9, 2013

Try d0. 0 denotes the beginning of the line.