Wikia

Vim Tips Wiki

Changes: Pasting registers

Edit

Back to page

(Remove html character entities)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 4: Line 4:
 
|previous=1302
 
|previous=1302
 
|next=1304
 
|next=1304
|created=August 11, 2006
+
|created=2006
 
|complexity=basic
 
|complexity=basic
 
|author=Mark Woodward
 
|author=Mark Woodward
Line 12: Line 12:
 
|category2=
 
|category2=
 
}}
 
}}
Just as <tt>"+p</tt> (or <tt>"*p</tt>) pastes the contents of the clipboard, other registers can be pasted as well.
+
Just as <code>"+p</code> (or <code>"*p</code>) pastes the contents of the clipboard, other registers can be pasted as well.
   
Use <tt>":p</tt> to paste the last command. For example, you might want to save a complex search and replace (<tt>:%s///g</tt>) that you have just used.
+
Use <code>":p</code> to paste the last command. For example, you might want to save a complex search and replace (<code>:%s///g</code>) that you have just used.
   
Use <tt>"/p</tt> to paste the last search.
+
Use <code>"/p</code> to paste the last search.
   
 
==References==
 
==References==
Line 22: Line 22:
   
 
==Comments==
 
==Comments==
Also, Ctrl-R in insert mode, and command mode, will paste the contents of a register, so when I want to paste from the clipboard, it's <tt><C-R>+</tt>, and if I want the last search, it's <tt><C-R>/</tt>.
+
Also, Ctrl-R in insert mode, and command mode, will paste the contents of a register, so when I want to paste from the clipboard, it's <code><C-R>+</code>, and if I want the last search, it's <code><C-R>/</code>.
   
 
----
 
----

Latest revision as of 06:19, July 13, 2012

Tip 1303 Printable Monobook Previous Next

created 2006 · complexity basic · author Mark Woodward · version 5.7


Just as "+p (or "*p) pastes the contents of the clipboard, other registers can be pasted as well.

Use ":p to paste the last command. For example, you might want to save a complex search and replace (:%s///g) that you have just used.

Use "/p to paste the last search.

ReferencesEdit

CommentsEdit

Also, Ctrl-R in insert mode, and command mode, will paste the contents of a register, so when I want to paste from the clipboard, it's <C-R>+, and if I want the last search, it's <C-R>/.


Around Wikia's network

Random Wiki