(Remove html character entities) |
(Adjust previous/next navigation + minor manual clean) |
||
Line 1: | Line 1: | ||
− | {{review}} |
||
{{TipImported |
{{TipImported |
||
|id=586 |
|id=586 |
||
|previous=584 |
|previous=584 |
||
− | |next= |
+ | |next=588 |
− | |created= |
+ | |created=2003 |
|complexity=basic |
|complexity=basic |
||
|author=Usman Latif |
|author=Usman Latif |
||
Line 12: | Line 11: | ||
|category2= |
|category2= |
||
}} |
}} |
||
+ | Using <tt>:put "</tt> pastes text from the default register below the current line. That is useful if some characters within a line have been copied, and you would like the copied text pasted as a separate line. |
||
− | Frequently I yank a few words or part of a line and like to have them pasted on a separate line. Vim provides the <tt>put</tt> and <tt>put!</tt> commands for that purpose but they are not mapped by default to anything. Typing the commands is much slower than inserting a line and pasting to it so I have created the following maps: |
||
+ | Use the following mappings in your [[vimrc]] to make that easier. The first pastes after the current line, while the second pastes before the current line. |
||
<pre> |
<pre> |
||
− | nnoremap ,p : |
+ | nnoremap ,p :put "<CR> |
− | nnoremap ,P : |
+ | nnoremap ,P :put! "<CR> |
</pre> |
</pre> |
||
Revision as of 02:11, 16 May 2012
Tip 586 Printable Monobook Previous Next
created 2003 · complexity basic · author Usman Latif · version 5.7
Using :put " pastes text from the default register below the current line. That is useful if some characters within a line have been copied, and you would like the copied text pasted as a separate line.
Use the following mappings in your vimrc to make that easier. The first pastes after the current line, while the second pastes before the current line.
nnoremap ,p :put "<CR> nnoremap ,P :put! "<CR>