Geek
Geek

Reputation: 27173

In vim is there a command for inline replacing of a line?

I would like to navigate to a line and start typing immediately . This should replace the contents of the existing line. It is basically replacing a line command but inline similar to what we can achieve through Change Inline wordc+i+w. How can I do that without first going to the line and then pressing dd and then going to insert mode and typing something?

Upvotes: 2

Views: 156

Answers (1)

FDinoff
FDinoff

Reputation: 31419

S should do what you want. It deletes the line and places you in insert mode.

S is a synonym for cc

From :h cc

                                                        cc
["x]cc                  Delete [count] lines [into register x] and start
                        insert linewise.  If 'autoindent' is on, preserve
                        the indent of the first line.

From :h S

                                                        S
["x]S                   Delete [count] lines [into register x] and start
                        insert.  Synonym for "cc" linewise.

Upvotes: 6

Related Questions