Copy yanked text to vim command line
A lot of times you have something you want to yank such as a file path or something you want to run over a regex. Lets say you grab a file path from a piece of code you are editing. And you want to do something like the following.
:edit /a/path/to/a.file
But a.file is your register "
So what you can do is
:edit <CTRL-R>"
Which becomes
:edit /a/path/to/a.file
And this will add your yanked code into the vim command line.
See the following for more information.
:help c_CTRL-R
Written by Colin Wood
Related protips
1 Response
This works in insert mode too! Also useful in insert mode: inserting from the "=" register, which lets you insert the result of vim commands.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#