Vim中有等价于o-<esc>-p吗?

Is there an equivalent to o-<esc>-p in Vim?

提问人:Cato Johnston 提问时间:6/24/2009 最后编辑:Keith PinsonCato Johnston 更新时间:8/14/2012 访问量:482

问:

当我拉一整行并按下时,由于换行符,Vim 会创建一个新行来放置被拉动的文本。但是,如果我拉扯了一行的一部分,有没有办法将拉扯的文本放在新行中?我目前做.这是唯一的办法吗?poESCp

vim 键盘快捷键 复制粘贴

评论


答:

8赞 Mark Rushakoff 6/24/2009 #1

以下是 Vim 帮助中的答案:

:[line]pu[t] [x]        Put the text [from register x] after [line] (default
                        current line).  This always works |linewise|, thus
                        this command can be used to put a yanked block as new
                        lines.
                        The cursor is left on the first non-blank in the last
                        new line.
                        The register can also be '=' followed by an optional
                        expression.  The expression continues until the end of
                        the command.  You need to escape the '|' and '"'
                        characters to prevent them from terminating the
                        command.  Example: >
                                :put ='path' . \",/test\"
<                       If there is no expression after '=', Vim uses the
                        previous expression.  You can see it with ":dis =".

:[line]pu[t]! [x]       Put the text [from register x] before [line] (default
                        current line).

但是colon-p-u-enter无论如何都是更多的击键=/

评论

0赞 Dan Olson 6/24/2009
很好的答案,如果经常使用,这当然可以绑定到另一个键序列以减少击键。
0赞 Keith Pinson 8/14/2012
尽管它更多的击键,但它节省了进入和退出插入模式的时间,这通常至少具有节省时间的外观(您不必伸手去拿 <kbd>ESC</kbd>)。
6赞 michael 6/24/2009 #2

有 o(c-r)0,因为您始终可以在插入模式下从寄存器粘贴,但前提是您希望在粘贴后保持插入模式