vehomzzz
vehomzzz

Reputation: 44578

what is the difference between C, cc, and S commands in vim

They seems to erase the line and enter the insertion mode.

Upvotes: 29

Views: 17942

Answers (2)

Michael Kristofik
Michael Kristofik

Reputation: 35188

From :h C...

Delete from the cursor position to the end of the line [...] and start insert. Synonym for c$.

And :h S gives us...

Delete [count] lines [...] and start insert. Synonym for cc.

Upvotes: 26

Michael Krelin - hacker
Michael Krelin - hacker

Reputation: 143081

  • C replaces the rest of the line (starting at cursor position) with your edit.
  • cc and S are synonyms and replace the whole line(s) with your edit.

Upvotes: 55

Related Questions