在vim中,是否有用于在线替换线路的命令?

在vim中,是否有用于在线替换线路的命令?,vim,Vim,我想导航到一行并立即开始键入。这将替换现有行的内容。它基本上取代了一个行命令,但内联命令与我们通过更改内联wordc+i+w可以实现的类似。如果不先到行,然后按dd,然后进入插入模式并键入内容,我怎么能做到这一点呢?S应该做你想做的事情。它将删除该行并将您置于插入模式 S是cc cc ["x]cc Delete [count] lines [into

我想导航到一行并立即开始键入。这将替换现有行的内容。它基本上取代了一个行命令,但内联命令与我们通过更改内联wordc+i+w可以实现的类似。如果不先到行,然后按dd,然后进入插入模式并键入内容,我怎么能做到这一点呢?

S
应该做你想做的事情。它将删除该行并将您置于插入模式

S
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 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.
:hs

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

@FDinoff
[“x]
是什么意思?@Geek
[“x]
是命令的可选部分,允许您将删除的部分放入寄存器x。您可以用任何其他字母替换x,将删除的部分放入该寄存器。如果不指定寄存器,则会将其置于默认寄存器中。