Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Paste registers in search or colon commands instead of using the clipboard
Back to page
Edit
Edit source
View history
Talk (0)
Edit Page
Paste registers in search or colon commands instead of using the clipboard
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
{{TipImported |id=490 |previous=489 |next=492 |created=2003 |complexity=intermediate |author=rainbrot |version=5.7 |rating=84/30 |category1=Usage |category2= }} You can type Ctrl-R to insert a register when in insert mode, or when typing in the command or search line. When you press Ctrl-R you will see <code>"</code> (quote) to prompt you to finish the command by entering a register. For example, press Ctrl-R then <code>a</code> to insert the contents of the <code>a</code> register, or Ctrl-R then <code>"</code> to insert the contents of the unnamed register. You can press <code>v</code> then move the cursor to visually select some text (say the text is "hello world"). If you press <code>y</code> the selected text is yanked (copied) into the unnamed register. You can now type <code>:%s/</code> then <code><C-r>"</code> (Ctrl-R quote), which would show the following in the command line: <pre> :%s/hello world </pre> You could complete the substitute command, to read, for example: <pre> :%s/hello world/goodbye everyone/gc </pre> Type <C-r><C-w> to paste the word under the cursor into the command line, or <C-r><C-a> to paste the WORD. ==References== *{{help|c_CTRL-R}} *{{help|i_CTRL-R}} *{{help|WORD}} ==Comments==
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Help
(
view source
)
Template:Navigation
(
view source
)
Template:TipImported
(
view source
)
Follow on IG
TikTok
Join Fan Lab