How do I replace the contents of the entire current line?
Answer
cc
Explanation
The cc command deletes the entire content of the current line (preserving indentation) and enters insert mode. It is equivalent to S.
How it works
ccclears the current line content- Preserves the leading indentation if
autoindentis set - Enters insert mode so you can type the replacement
Example
old function content here
Pressing cc clears the line to:
(cursor in insert mode after the indentation)
Tips
Sis a synonym forcc3ccchanges 3 lines at onceCchanges from cursor to end of line only- The deleted text is saved to the default register