tags:

views:

140

answers:

3

When i yank a whole line and press p in creates a new line to put the yanked text. Because of the newline characters.

But if I yank part of a line is there a way to put that yanked text in a new line.

I currently do o-esc-p. Is this the only way?

+7  A: 

Here's your answer from Vim help:

:[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).

But colon-p-u-enter is more keystrokes anyway =/

Mark Rushakoff
Good answer, this could certainly be bound to another key sequence to cut down the keystrokes if it was used frequently.
Dan Olson
+3  A: 

Theres o(c-r)0 as you can always paste from registers while your in insert mode but thats only if you want to remain in insert mode after the paste

michael
The answer or not, that is freakin cool
A: 

you can use macros (:help q)

Adrian Panasiuk